Skip to content

Repository files navigation

Features

  • Display a red moon during bloodmoons.
  • Show the remaining time with a boss bar.
  • Preserve active bloodmoons after server restarts.
  • Synchronize the bloodmoon state with connected players.
  • Control bloodmoons through commands (requieres admin perms).
  • Use bloodmoon lifecycle events through the API.

Start a bloodmoon

/bloodmoon start <duration>

The duration is measured in ticks. There are 20 ticks in one second.

/bloodmoon start 12000

Stop the bloodmoon

/bloodmoon stop

Get the remaining time

/bloodmoon get

Set the remaining time

/bloodmoon set <remainingTicks>

Setting the remaining time to 0 stops the bloodmoon.

Change the remaining time

/bloodmoon change <delta>

Positive values extend the bloodmoon. Negative values shorten it.

API

Control the bloodmoon

Bloodmoon bloodmoon = Bloodmoon.getInstance();

bloodmoon.startBloodmoon(12_000);
bloodmoon.changeBloodmoonRemainingTicks(1_200);
bloodmoon.stopBloodmoon();

Check the bloodmoon state

if (Bloodmoon.isBloodmoonActive(level)) {
    // A bloodmoon is active.
}

Register lifecycle events

BloodmoonEvents.STARTED.register((bloodmoon, durationTicks) -> {
});

BloodmoonEvents.TICK.register((bloodmoon, remainingTicks) -> {
});

BloodmoonEvents.STOPPED.register(bloodmoon -> {
});

The tick event runs once per second while a bloodmoon is active.

About

Manages timed bloodmoon events with persistent state, synchronized visuals, commands, and lifecycle events.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages