Skip to main content

How Rallies Work

What happens between typing /rally go harbour and the crowd landing, and why each step is there.

The sequence​

  1. Guards. The rally is refused if one is already in progress, if the cooldown has not elapsed, or if the destination has no world.
  2. Cross-world check. If allow-cross-world is false and the host is in a different world to the destination, the rally is refused.
  3. Crowd collection. Opted-in online players are gathered. The host who ran the rally is added too - opted in or not - unless they are already within 16 blocks of the destination, so they travel with the crowd to a stop they are not already at (a host who only comes along to lead is never held by stage mode). With allow-cross-world: false, players in other worlds are skipped and told why.
  4. Nobody check. If the crowd is empty, the rally is refused with "nobody is opted in". This is checked before the safety check, because telling a host their destination is unsafe is unhelpful when the real problem is that nobody is coming.
  5. Safety check. Unless safety-checks is off, or force was passed, the destination must pass validation.
  6. Chunk preload. The destination chunk is loaded asynchronously while the countdown runs, so the crowd does not arrive into an unloaded chunk.
  7. Countdown. Chat, title, and tick sound each second. A failed preload is logged rather than aborting the rally.
  8. Re-collection. When the countdown ends the crowd is gathered again, so players who opted in during the countdown come along, and anyone who logged out or opted out is dropped.
  9. Teleport. Players are dismounted, given a scattered landing spot, and moved in batches of teleports-per-tick.
  10. Arrival. Return points are recorded, arrival title and sound fire, and the rally is written to history.

If any of this throws, the in-progress flag is always cleared, so a failed rally cannot wedge the plugin until a restart.

Destination safety checks​

With safety-checks: true (the default), a destination must satisfy all of the following:

  • It is above the world's minimum height and below the top two blocks of the build limit.
  • The blocks at foot level and head level are both passable and are not lava.
  • Foot, head, and ground blocks are not dangerous: lava, fire, soul fire, campfires, soul campfires, magma blocks, cactus, sweet berry bush, powder snow, wither roses, or end and nether portals.
  • The block below is solid, so the crowd is not dropped into the void or into open air.
  • In the Nether, the destination is below Y 127, which keeps rallies off the Nether roof.

A destination that fails is refused with a message pointing at force. Adding force to the command skips this check for that one rally.

Scatter​

Arrivals are spread over scatter-radius blocks so the crowd is not a single stack of players. Each landing spot is picked at a random angle and distance from the destination, then centred on the block.

With safety checks on, a candidate spot is only used if its chunk is already loaded and a safe position exists within four blocks up or down. RallyPoint tries several candidates and falls back to the destination itself if none work, so a scattered arrival never silently drops someone into a wall.

Set scatter-radius: 0 to put everyone exactly on the destination.

Batching and dismounting​

Teleports are spread across ticks at teleports-per-tick players per tick, rather than moving a hundred players in a single tick. Before being moved, each player is taken off any vehicle: boats, minecarts, and horses stay where they were.

Chunk preloading and the teleport itself both go through Paper's asynchronous APIs, which is why RallyPoint is Paper-only.

Return points​

A return point is recorded for each player when they arrive, both from a rally and from /rally catchup. /rally return sends home every online player who has one, whether or not they are still opted in.

Players who are offline at that moment keep their return point and are teleported home the first time they log in afterwards, with a different message explaining what happened. This is why nobody ends up stranded at the last stop after an event.

Missed rallies​

Each rally increments a serial number, and each player records the serial of the last rally they were part of. The serial is persisted, so it keeps counting across a restart rather than resetting to zero and silently disabling missed-rally notices.

When an opted-in player joins and their recorded serial is behind the current one, they are told they missed a rally and pointed at /rally catchup.

Stage mode​

Stage mode holds the opted-in crowd in place between rallies.

  • spectator (default) puts each held player into spectator mode and remembers the game mode they had.
  • freeze leaves their game mode alone and cancels any movement that would change the block they are standing on. They can still look around.

Players with rally.admin are never held, so hosts keep flying the shot.

Everything needed to undo stage mode is written to stage.yml the moment it is applied. If the server crashes or the plugin is disabled mid-mode, the crowd is restored: online players on the next enable, offline players the next time they join. A player who is no longer in spectator mode by the time the restore runs is left alone, rather than being pushed back into a mode they no longer have.

Turning stage mode off restores everyone with one disk write rather than one per player, so releasing a large crowd is not a hundred YAML saves.