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 Summary
-
Constructor Summary
ConstructorDescriptionDungeonTrigger
(String displayName) DungeonTrigger
(String displayName, Map<String, Object> config) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCondition
(TriggerCondition condition) abstract void
Used to build a hotbar menu for this trigger.abstract MenuButton
Creates and returns a button for use with the trigger browser menu.final boolean
checkConditions
(TriggerFireEvent event) Checks if all the conditions are met for this trigger to fire.clone()
final void
disable()
void
enable
(DungeonFunction function) void
init()
final void
void
void
Override me if you have additional code to run when this trigger is DISABLED (I.e.void
onEnable()
Override me if you have additional code to run when this trigger is ENABLED (I.e.void
onTrigger
(TriggerFireEvent event) Override me to add additional code to execute upon this trigger successfully being fired.void
removeCondition
(TriggerCondition condition) void
setDisplayName
(String displayName) final void
trigger()
void
trigger
(MythicPlayer aPlayer) final void
trigger
(MythicPlayer aPlayer, boolean disable) final void
triggerParty
(Instance instance) Deprecated.final void
triggerPlayer
(MythicPlayer aPlayer) Deprecated.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
-
-
Constructor Details
-
DungeonTrigger
-
DungeonTrigger
-
-
Method Details
-
init
public void init()- Specified by:
init
in classDungeonElement
-
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
-
disable
public final void disable()- Overrides:
disable
in classDungeonElement
-
initConditions
public final void initConditions() -
checkConditions
Checks if all the conditions are met for this trigger to fire.- Returns:
- true if all conditions associated with this trigger passed.
-
addCondition
-
removeCondition
-
onTrigger
Override me to add additional code to execute upon this trigger successfully being fired. -
triggerPlayer
Deprecated.Performs the trigger for a target player.- Parameters:
aPlayer
- The player associated with triggering.
-
triggerParty
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
-
trigger
-
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 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 trigger. Assign `menu` with a new HotbarMenu object and fill out the methods provided.- Specified by:
buildHotbarMenu
in classDungeonElement
- See Also:
-
initConditionsMenu
public void initConditionsMenu() -
setDisplayName
-
clone
- Overrides:
clone
in classDungeonElement
-