Class HatSwitchChallenge

java.lang.Object
com.storytimeproductions.models.stgames.challenges.HatSwitchChallenge
All Implemented Interfaces:
StoryBlitzChallenge, org.bukkit.event.Listener

public class HatSwitchChallenge extends Object implements StoryBlitzChallenge, org.bukkit.event.Listener
A challenge where players must open a chest and equip the golden helmet inside. The challenge spawns chests in specified regions, and players must complete the challenge by equipping the golden helmet.
  • Constructor Details

    • HatSwitchChallenge

      public HatSwitchChallenge(List<Cuboid> spawnRegions)
      Constructs a HatSwitchChallenge using the provided spawn regions.
      Parameters:
      spawnRegions - List of Cuboid regions to spawn chests in
  • Method Details

    • getDescription

      public String getDescription()
      Description copied from interface: StoryBlitzChallenge
      Returns the description of the challenge, which is shown to players.
      Specified by:
      getDescription in interface StoryBlitzChallenge
      Returns:
      The description of the challenge.
    • start

      public void start(List<org.bukkit.entity.Player> players)
      Description copied from interface: StoryBlitzChallenge
      Called when the challenge starts for the given players.
      Specified by:
      start in interface StoryBlitzChallenge
      Parameters:
      players - The players in the game.
    • isCompleted

      public boolean isCompleted(org.bukkit.entity.Player player)
      Description copied from interface: StoryBlitzChallenge
      Checks if the player has completed the challenge.
      Specified by:
      isCompleted in interface StoryBlitzChallenge
      Parameters:
      player - The player to check.
      Returns:
      true if the player has completed the challenge, false otherwise.
    • cleanup

      public void cleanup(List<org.bukkit.entity.Player> players)
      Description copied from interface: StoryBlitzChallenge
      Called when the challenge ends (cleanup).
      Specified by:
      cleanup in interface StoryBlitzChallenge
      Parameters:
      players - The players in the game.
    • onInventoryClick

      public void onInventoryClick(org.bukkit.event.inventory.InventoryClickEvent event)
      Handles when a player equips the golden helmet from a chest.
    • onPlayerInteractEntity

      public void onPlayerInteractEntity(org.bukkit.event.player.PlayerInteractEntityEvent event)
      Handles player interaction with item frames containing a golden helmet.
      Parameters:
      event - The PlayerInteractEntityEvent triggered when a player interacts with an entity