Skip to content

SnPacketBosses v2.0.0

Choose a tag to compare

@ValentinTarnovsky ValentinTarnovsky released this 20 Aug 14:30
· 102 commits to main since this release

What it is

SnPacketBosses gives a player a boss fight that only they can see, and makes them mine it
down with EdTools instead of hitting it.

The boss is not an entity. It exists only as packets sent to its owner, so it does not count
against the entity cap, does not tick, does not path, cannot be hit or looted by anyone
walking past, and cannot be griefed off a claim. Two players standing next to each other can
be fighting two different bosses and neither one sees the other's.

The fight

A boss is summoned from a boss egg: an ordinary item players can buy, sell, store and
trade. Each egg carries its own attempt count in its item data, so an egg is worth exactly
what it says it is worth, and a renamed one still works while a hand-crafted lookalike does
not.

Damage comes from EdTools block breaks. Every block the owner mines takes health off the
boss, so the fight is paced by their gear and their mine rather than by their reach. A boss
bar tracks health and the clock, and a private hologram floats over the boss with whatever
text the file defines.

Run the clock out and the egg comes back reading one attempt fewer. At zero it is gone.

Abilities

Each boss can carry three, in any combination, all telegraphed before they land:

  • Potion effects - any effect the server knows, with its own amplifier, duration,
    cooldown, chance and range, and as many entries as the file lists.
  • Fireballs - the boss throws one and the owner can hit it back. A deflected fireball
    damages the boss, and it can finish the fight.
  • Armored phase - the boss drops to head height and shrugs off mining damage until the
    owner breaks the armor by hitting it a configured number of times.

Movement

A boss either orbits its owner and follows them across worlds, or sits pinned at a fixed
location. A following boss keeps up smoothly through sprint, elytra and Speed effects, and
snaps cleanly rather than sliding when it falls too far behind.

It survives everything

Quit mid-fight and the fight pauses; it is restored when you come back, health, clock and
attempts intact. Teleport, change world, die or reload the server and the boss is redrawn
where it belongs. When a fight ends, it ends the same way every time, whether it was won,
timed out, killed by an admin, or interrupted by a server restart.

For the server owner

Every boss is one file in bosses/, and the file name is the boss id, so adding a boss means
adding a file. The folder is seeded once on a fresh install and never written to again: a file
you delete stays deleted.

While a fight is running you can restrict commands, teleports and flight, with an allowlist
and a bypass permission. /packetbosses always stays available so an admin can never be
locked out of ending a stuck fight.

Commands are /packetbosses give, kill, list and view, plus the reload, help and
debug SnLib injects. view lets an admin watch someone else's fight over their shoulder;
the spectator sees everything and can change nothing.

Every player-facing string lives in the language file. There is no hardcoded text.

Installing

  • SnLib.jar goes in plugins/. SnPacketBosses does not run without it.
  • Also required: EdTools and packetevents.
  • Paper 1.21.2 or newer. The floor is real rather than cautious: the packet this plugin
    uses to reposition a boss without the client smoothing the movement back out does not exist
    below 1.21.2.
  • Drop the jar in plugins/ and start the server. It writes its own config.yml, its
    language file and an example boss on first boot.