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 Summary
ConstructorsConstructorDescriptionHatSwitchChallenge(List<Cuboid> spawnRegions) Constructs a HatSwitchChallenge using the provided spawn regions. -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when the challenge ends (cleanup).Returns the description of the challenge, which is shown to players.booleanisCompleted(org.bukkit.entity.Player player) Checks if the player has completed the challenge.voidonInventoryClick(org.bukkit.event.inventory.InventoryClickEvent event) Handles when a player equips the golden helmet from a chest.voidonPlayerInteractEntity(org.bukkit.event.player.PlayerInteractEntityEvent event) Handles player interaction with item frames containing a golden helmet.voidCalled when the challenge starts for the given players.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface StoryBlitzChallenge
getDescriptionWithGoobModifier and TypeMethodDescriptiondefault StringgetDescriptionWithGoob(String normalDescription) Returns a description with a chance to include "goob" for fun.
-
Constructor Details
-
HatSwitchChallenge
-
-
Method Details
-
getDescription
Description copied from interface:StoryBlitzChallengeReturns the description of the challenge, which is shown to players.- Specified by:
getDescriptionin interfaceStoryBlitzChallenge- Returns:
- The description of the challenge.
-
start
Description copied from interface:StoryBlitzChallengeCalled when the challenge starts for the given players.- Specified by:
startin interfaceStoryBlitzChallenge- Parameters:
players- The players in the game.
-
isCompleted
public boolean isCompleted(org.bukkit.entity.Player player) Description copied from interface:StoryBlitzChallengeChecks if the player has completed the challenge.- Specified by:
isCompletedin interfaceStoryBlitzChallenge- Parameters:
player- The player to check.- Returns:
- true if the player has completed the challenge, false otherwise.
-
cleanup
Description copied from interface:StoryBlitzChallengeCalled when the challenge ends (cleanup).- Specified by:
cleanupin interfaceStoryBlitzChallenge- 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
-