AT-PinataParty

How a party runs

What happens from the moment you summon a piñata to the moment it breaks.

A party is one piñata. An admin summons it, players hit it, and when it has taken enough hits it breaks and pays out.

Four stages side by side. Summon with slash pp summon, a countdown, players hitting the piñata, then it breaks and pays out

Summoning

An admin runs /pp summon <location> for a saved spawn point, or /pp summonhere to use where they are standing. See Commands.

A countdown runs first, pinata.spawn-cooldown seconds long. Every second of it, every player online gets a chat line and a ping, and a title on the first tick. Then the piñata appears and everyone is told where.

You can have several parties running at once. pinata.limit caps how many, and -1 means no cap. When the cap is reached, the summon fails with a message.

Running your own commands at the start

The moment the piñata appears, the plugin can fire commands for you.

The once list runs a single command, the per-player list is repeated for every player online with their name filled in
config.yml
party-start-commands:
  once:
    - "broadcast &d&lPINATA PARTY &fhas started at &e%location%&f!"
  per-player:
    - "effect give %player% speed 30 1"
ListRuns
onceA single time, however many players are online
per-playerOnce for every player online at that moment, with %player% filled in

%location% works in both and gives the spawn point name. Both lists are empty out of the box, so nothing happens until you fill them in.

per-player is repeated for every player online. On a busy server that is a lot of commands at once, so keep them cheap and avoid anything that writes to a database.

A broadcast line in either list is sent by the plugin itself, so it arrives without another plugin's prefix. See Broadcasts.

The piñata itself

pinata.type decides which mob it is. Any living mob works. Llamas are the default because they can wear the rainbow carpet.

Once spawned it is set up so it cannot wander off or vanish:

  • It never despawns, even with nobody nearby.
  • Its chunk is held loaded for as long as the party runs.
  • If pinata.movement.teleport-back-interval is above zero, going further than that many blocks from the spawn point teleports it straight back.

It also gets a random shove every pinata.movement.interval ticks so it drifts around instead of standing still.

The piñata cannot actually be damaged by anything. A player's hit is counted rather than applied, and every other source (arrows, a wandering mob, fire, lava, a fall, drowning) is ignored outright, so it can never die early and cut the party short. Players cannot ride it either.

Only a player's own swing counts. Shooting it with a bow does nothing at all, so a party has to be fought up close.

Hitting it

Every swing runs through three checks, in this order.

Cooldown

pinata.hit-cooldown is a per player wait in seconds. Swing again before it is up and the hit does not count, and the player is told to wait. This is what stops one player with a fast weapon taking the whole piñata alone.

Hit chance

pinata.hit-chance is the chance out of 100 that the swing lands at all. At 75.0, one swing in four is a miss with a message, and it does not count. Set it to 100.0 if you want every swing to count.

It counts

The hit is recorded, the player hears sounds.hit, the hologram counter drops by one, the hit reward pool is rolled for that player, and they may get knocked back.

Turn on pinata.broadcast-hits and every hit is announced in chat with a running count. It is off by default, because a busy party is a lot of chat.

How many hits it takes

The total is worked out once, when the piñata spawns:

hits needed = pinata.hits-multiplier × number of players online

At the default multiplier of 3, ten players online means thirty hits. One player online means three. The count does not change if people join or leave mid party.

Knockback

A landed hit has a pinata.knockback.chance out of 100 of shoving the player away from the piñata. strength is how far, upward-strength is how high. A particle burst can go with it. Turn it off by setting the chance to 0.

When it breaks

The moment the hit count is reached, all at once:

  1. sounds.death plays where the piñata was standing, so players nearby hear the pop.
  2. Every player within 25 blocks is shoved away from the piñata.
  3. Fireworks go off, one at a time, as set under fireworks.
  4. Everyone who landed at least one hit gets a roll of the death reward pool.
  5. The player who landed the final hit gets a roll of the last-hit pool as well.
  6. sounds.end plays for everyone online.
  7. Everyone gets the end title, subtitle and chat line.

Then the piñata is removed, its hologram is deleted, and the chunk is released.

See Rewards for the payouts and Effects and sounds for the fireworks.

/pp stop ends every running party immediately and pays out nothing. It is a cancel, not an early finish.

Players who leave

A player who logs out before the piñata breaks is skipped when the rewards are handed out, including the last hit pool. Nothing is saved for them to collect later.

On this page