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 Summary
-
Constructor Summary
ConstructorDescriptionDungeonFunction
(String namespace) DungeonFunction
(String namespace, Map<String, Object> config) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Used to build a hotbar menu for this function.abstract MenuButton
Creates and returns a button for use with the function browser menu.clone()
final void
disable()
final void
final void
execute
(TriggerFireEvent event) void
executeForParty
(TriggerFireEvent triggerEvent) Deprecated.void
executeForPlayer
(TriggerFireEvent triggerEvent) Deprecated.void
init()
void
Override me if you have additional code to run when this function is DISABLED.void
onEnable()
Override me if you have additional code to run when this function is ENABLED.void
onExecute
(TriggerFireEvent triggerEvent) Override me if you have additional code to run when this function is EXECUTED.abstract void
runFunction
(TriggerFireEvent triggerEvent, List<MythicPlayer> targets) void
setCategory
(FunctionCategory category) void
setDisplayName
(String displayName) void
setInstance
(Instance inst) void
setLocation
(org.bukkit.Location loc) void
setTrigger
(DungeonTrigger trigger) Methods inherited from class net.playavalon.mythicdungeons.api.parents.DungeonElement
initFields, serialize
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
-
Field Details
-
category
-
requiresTarget
public boolean requiresTarget
-
-
Constructor Details
-
DungeonFunction
-
DungeonFunction
-
-
Method Details
-
init
public void init()- Specified by:
init
in classDungeonElement
-
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
-
disable
public final void disable()- Overrides:
disable
in classDungeonElement
-
setTrigger
-
setCategory
-
executeForPlayer
Deprecated. -
executeForParty
Deprecated. -
runFunction
-
onExecute
Override me if you have additional code to run when this function is EXECUTED.- Parameters:
triggerEvent
- The event that triggered this execution.
-
execute
-
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 classDungeonElement
- 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 classDungeonElement
- See Also:
-
setInstance
-
setDisplayName
-
clone
- Overrides:
clone
in classDungeonElement
-