Class DungeonTrigger

java.lang.Object
net.playavalon.mythicdungeons.api.parents.DungeonElement
net.playavalon.mythicdungeons.api.parents.DungeonTrigger
All Implemented Interfaces:
Cloneable, org.bukkit.configuration.serialization.ConfigurationSerializable, org.bukkit.event.Listener
Direct Known Subclasses:
TriggerBlockDetector, TriggerChat, TriggerDistance, TriggerDungeonStart, TriggerGate, TriggerInteract, TriggerKeyItem, TriggerLeaveDungeon, TriggerMobDeath, TriggerMythicMobDeath, TriggerPlayerDeath, TriggerRedstone, TriggerRemote

public abstract class DungeonTrigger extends DungeonElement implements org.bukkit.event.Listener, Cloneable, org.bukkit.configuration.serialization.ConfigurationSerializable
  • Field Details

  • Constructor Details

    • DungeonTrigger

      public DungeonTrigger(String displayName, Map<String,Object> config)
    • DungeonTrigger

      public DungeonTrigger(String displayName)
  • Method Details

    • init

      public void init()
      Specified by:
      init in class DungeonElement
    • onEnable

      public void onEnable()
      Override me if you have additional code to run when this trigger is ENABLED (I.e. Starting a timer to perform a check every X ticks instead of via Event Listener.)
    • onDisable

      public void onDisable()
      Override me if you have additional code to run when this trigger is DISABLED (I.e. Canceling the timer mentioned in the `onEnable()` override.)
    • enable

      public void enable(@Nullable DungeonFunction function)
    • disable

      public final void disable()
      Overrides:
      disable in class DungeonElement
    • initConditions

      public final void initConditions()
    • checkConditions

      public final boolean checkConditions(TriggerFireEvent event)
      Checks if all the conditions are met for this trigger to fire.
      Returns:
      true if all conditions associated with this trigger passed.
    • addCondition

      public void addCondition(TriggerCondition condition)
    • removeCondition

      public void removeCondition(TriggerCondition condition)
    • onTrigger

      public void onTrigger(TriggerFireEvent event)
      Override me to add additional code to execute upon this trigger successfully being fired.
    • triggerPlayer

      @Deprecated public final void triggerPlayer(MythicPlayer aPlayer)
      Deprecated.
      Performs the trigger for a target player.
      Parameters:
      aPlayer - The player associated with triggering.
    • triggerParty

      @Deprecated public final void triggerParty(Instance instance)
      Deprecated.
      Performs the trigger for all players in the party.
      Parameters:
      instance - The dungeon instance the trigger occurred in.
    • trigger

      public final void trigger()
    • trigger

      public void trigger(MythicPlayer aPlayer)
    • trigger

      public final void trigger(MythicPlayer aPlayer, boolean disable)
    • buildMenuButton

      public abstract MenuButton buildMenuButton()
      Creates and returns a button for use with the trigger browser menu. MenuButton can be initialized with a Spigot Material, and provided with a display name, lore, enchant effect, and amount.
      Specified by:
      buildMenuButton in class DungeonElement
      Returns:
      The menu button that will be displayed in the menu.
      See Also:
    • buildHotbarMenu

      public abstract void buildHotbarMenu()
      Used to build a hotbar menu for this trigger. Assign `menu` with a new HotbarMenu object and fill out the methods provided.
      Specified by:
      buildHotbarMenu in class DungeonElement
      See Also:
    • initConditionsMenu

      public void initConditionsMenu()
    • setDisplayName

      public void setDisplayName(String displayName)
    • clone

      public DungeonTrigger clone()
      Overrides:
      clone in class DungeonElement