Seven complete plugins, smallest first. Every one compiles against the API jar in
releases/, and every one is commented with the reasoning rather than only
the mechanics.
They are meant to be read in order and then copied. Each file's javadoc header carries
the plugin.yml that goes with it.
| Example | Reads | Writes | Needs Premium | |
|---|---|---|---|---|
| 1 | QuickStartPlugin | the provider, spawn and death events | nothing | no |
| 2 | MobInspectorPlugin | every query in the API | nothing | no |
| 3 | SpawnControlPlugin | pre-spawn event | cancels and relocates spawns | no |
| 4 | BountyPlugin | death, damage, kill counts | damage amounts | no |
| 5 | LootAugmentPlugin | loot event, damage tables | the drop list | no |
| 6 | RaidAnnouncerPlugin | all three raid events, RaidView |
starts and stops raids | for the command only |
| 7 | CompanionPerksPlugin | companion events | player effects | to see it fire |
The smallest useful hook. EpicMobsProvider.find(), a logged line when Epic Mobs is absent,
two event handlers, one guarded API call. Everything else is a variation on this shape.
/mobinfo, /mobinfo list, /mobinfo raid, /mobinfo me, /mobinfo <name>. Every query
the API offers, including the ones that are easy to miss: damageByPlayer(), phase(),
owner(), getDiscoveredCount, and the 1.1.0 addition mythicMob(). Also shows depend
plus EpicMobsProvider.get(), the right pattern for a plugin that is useless without Epic
Mobs.
Four spawn rules, from a blunt world blocklist to relocating a spawn away from a sleeping player instead of refusing it. Needs no API instance at all: pure event handling, so it behaves identically in both editions.
Paying by damage share rather than by last hit, using damageByPlayer(). Also covers
first-kill detection with getKillCount, a permission that raises damage through
EpicMobDamageEvent, and wrapping a handler so a failure costs only that payout.
The drop list is live: adding a boss trophy, duplicating an existing drop for a lucky player, sending participation items straight to inventories, and cancelling loot entirely in one world.
Start, wave and end, plus a one-second repeating task that reads the live RaidView into a
boss bar and stops itself cleanly. /raidcall shows the edition check that turns
canMutate() into a message a server owner can act on.
Companion summon and death, and the one guard worth memorising: a companion death fires
CompanionDeathEvent and EpicMobDeathEvent, so filter with handle.owner() != null
to avoid counting it twice.
The examples build as one project, which is how they stay honest: if the API changes shape, this build breaks.
cd examples
mvn compileThat is a compile check only. It does not produce a usable plugin, because a real plugin has
one main class and one plugin.yml, and this project has seven of the former and none of
the latter.
- Copy the
.javafile into your own plugin, under your own package. - Copy the
plugin.ymlfrom its javadoc header, and merge it with yours. - Add the API dependency the way
Getting started shows, at
providedscope. - Replace the placeholder bits:
pay()in the bounty example is a log line, not an economy.
| Java | 21 |
| Spigot API | any reasonably recent version. The pom names the one Epic Mobs itself is built against |
| Epic Mobs Rework | at runtime only, not to compile |