Getting Started
Class MyCustom
The MyCustom
class is a custom implementation of the Trigger
class in the context of a Minecraft plugin. Triggers are events or conditions that trigger specific responses in the game. In this case, MyCustom
is designed to respond to a click event on a player's inventory.
Constructor
Description: This is the constructor of the
MyCustom
class. Takes an effect parameter, which is an object of theEffect
class. The Effect class contains the logic that will be executed when the trigger meets the conditions and filters of thisEffect
only if the effect contains these characteristics.Typical Use: An instance of
MyCustom
is created by providing a specificEffect
object that defines the action that will be performed when the trigger is activated.
Dispatch
Description: This method overrides the
dispatch
method of the Trigger base class. TheTrigger
class already has an implementation of how the effects will be executed with this trigger but it can be overridden if you want to implement your own logic.Parameters:
player
: The player to whom the trigger is applied.data
: Data associated with the trigger that could be used in the execution of the effect.
onClick
Description: Here you can create your own logic around the
@EventHandler
, but you must always pass a player and a TriggerData.
Last updated