Class DungeonFunction

java.lang.Object
net.playavalon.mythicdungeons.api.parents.DungeonElement
net.playavalon.mythicdungeons.api.parents.DungeonFunction
All Implemented Interfaces:
Cloneable, org.bukkit.configuration.serialization.ConfigurationSerializable, org.bukkit.event.Listener
Direct Known Subclasses:
FunctionAllowBlock, FunctionBlockEditor, FunctionCheckpoint, FunctionChunkLoad, FunctionCommand, FunctionDoorControl, FunctionFinishDungeon, FunctionGiveItem, FunctionHologram, FunctionLeaveDungeon, FunctionLives, FunctionMessage, FunctionMulti, FunctionMythicSignal, FunctionMythicSkill, FunctionPlaySound, FunctionRedstoneBlock, FunctionRemoteTrigger, FunctionRevivePlayer, FunctionReward, FunctionSpawnMythicMob, FunctionSpawnNPC, FunctionStartDungeon, FunctionTeleport, FunctionTitle

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

    • category

      public FunctionCategory category
    • requiresTarget

      public boolean requiresTarget
  • Constructor Details

    • DungeonFunction

      public DungeonFunction(String namespace, Map<String,Object> config)
    • DungeonFunction

      public DungeonFunction(String namespace)
  • Method Details

    • init

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

      public void setLocation(org.bukkit.Location loc)
    • onEnable

      public void onEnable()
      Override me if you have additional code to run when this function is ENABLED.
    • onDisable

      public void onDisable()
      Override me if you have additional code to run when this function is DISABLED.
    • enable

      public final void enable(Instance instance, org.bukkit.Location loc)
    • disable

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

      public void setTrigger(DungeonTrigger trigger)
    • setCategory

      public void setCategory(FunctionCategory category)
    • executeForPlayer

      @Deprecated public void executeForPlayer(TriggerFireEvent triggerEvent)
      Deprecated.
    • executeForParty

      @Deprecated public void executeForParty(TriggerFireEvent triggerEvent)
      Deprecated.
    • runFunction

      public abstract void runFunction(TriggerFireEvent triggerEvent, List<MythicPlayer> targets)
    • onExecute

      public void onExecute(TriggerFireEvent triggerEvent)
      Override me if you have additional code to run when this function is EXECUTED.
      Parameters:
      triggerEvent - The event that triggered this execution.
    • execute

      public final void execute(TriggerFireEvent event)
    • buildMenuButton

      public abstract MenuButton buildMenuButton()
      Creates and returns a button for use with the function 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 function. Use `menu.addMenuItem()` to add buttons to the hotbar menu, creating a `new MenuItem()` and filling in the provided methods.
      Specified by:
      buildHotbarMenu in class DungeonElement
      See Also:
    • setInstance

      public void setInstance(Instance inst)
    • setDisplayName

      public void setDisplayName(String displayName)
    • clone

      public DungeonFunction clone()
      Overrides:
      clone in class DungeonElement