DUXPLIMA Documentation

Concepts

The three states a player is in, what entering and leaving do to the inventory, tags, the record, and the boards.

Five ideas carry the whole plugin: the state, the safe inventory, the combat tag, the record and the boards.

The state

Every player is in one of three states.

StateMeansCan hit and be hit by
OffThe normal lobby playernobody, while arena.only-fighters-may-fight is on
Warming upStanding still before a switch, in or outas in the state they are leaving
OnA fighter, holding the kitother fighters

One press of the toggle item or /pvp moves between them:

Pressed whileDoes
OffStarts the warm-up in, warm-up.enter-ms (3 seconds)
OnStarts the warm-up out, warm-up.leave-ms (8 seconds)
Warming upStops the warm-up; the player stays as they were

Moving more than warm-up.move-limit (1.5) blocks from where the warm-up started stops it too. The way out is longer than the way in on purpose: a player who is losing cannot step out the moment the fight turns. See Turning PvP on and off.

The safe inventory

Turning PvP on takes the player's whole inventory, armour and off hand included, writes it to the database, and only then hands out the kit. If the write fails, the items go straight back and PvP stays off. Leaving, by the toggle, by a death or by quitting, gives the items back and only then deletes the saved copy.

If the server stops hard while a player fights, the copy is still in the database, and the player gets their items back the next time they join, with the line pvp.recovered. On a network sharing one database, that can be any server of the network. See The kit.

The combat tag

A hit between two fighters tags both of them for combat-tag.duration-ms (10 seconds), and every further hit starts the time again. While tagged:

  • only the commands in combat-tag.allowed-commands run;
  • quitting counts as a death on the record.

The tag ends when its time runs out or the player dies. See Combat tag.

The record

Every player has one record:

FigureGrows when
KillsThey kill another fighter
DeathsThey die while fighting, or quit while tagged
RatioKills divided by deaths, two decimals; kills alone while deaths is 0
StreakEach kill; a death sets it back to 0
Best streakTheir streak passes it. It never goes down

/pvp stats shows it. A death while fighting also ends the fight: the player respawns with PvP off and their own items.

Boards

BoardRanks by
killsKills in the period
streakThe longest streak reached in the period

Each is kept for alltime, monthly, weekly and daily. The boards are read again every leaderboard.refresh-seconds (15) and answered from memory, so a hologram can ask for them as often as it likes. See Placeholders.

Related: Setting up the fight, Turning PvP on and off, config.conf