Interface CelebrationService


public interface CelebrationService
Victory celebrations: the catalog winners choose from and the previews of the cosmetics menu.

When a match is won, each winner still in it celebrates with the celebration they chose and own - see CosmeticsService - or the server's default. VictoryCelebrationEvent lets an addon change or suppress those choices before playback starts. A celebration that fails never delays the match's restart.

Celebrations are part of every edition, Free included, as are the victory-effect cosmetics that choose them. Methods that change something must be called on the main thread.

Since:
1.8.0
  • Method Details

    • isAvailable

      boolean isAvailable()
      Whether celebrations exist on this server.
    • getCelebrations

      @NotNull @NotNull List<CelebrationDefinition> getCelebrations()
      Every celebration, in the server's order.
    • getCelebration

      @NotNull @NotNull Optional<CelebrationDefinition> getCelebration(@NotNull @NotNull String id)
      The celebration with this ID.
    • getDefaultCelebration

      @NotNull @NotNull Optional<CelebrationDefinition> getDefaultCelebration()
      The celebration winners play when they chose none.
    • preview

      boolean preview(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String celebrationId)
      Plays a celebration for one player only, wherever they are, as the cosmetics menu previews it; nobody else sees or hears it.
      Returns:
      whether anything plays
    • stopPreview

      void stopPreview(@NotNull @NotNull org.bukkit.entity.Player player)
      Ends the player's preview, if one plays.