Class AdditionsEvent

java.lang.Object
net.gcnt.additionsplus.files.events.AdditionsEvent

public class AdditionsEvent extends Object
Class that contains all information about a custom event that can be triggered from anywhere.
  • Constructor Details

  • Method Details

    • fromString

      public static AdditionsEvent fromString(String identifier)
      Get a custom event from its identifier.
      Parameters:
      identifier - Identifier of the event.
      Returns:
      AdditionsEvent when found, null if not.
    • getAuthor

      public String getAuthor()
      Get the author of the custom event
      Returns:
      Author name
    • getDescription

      public String getDescription()
      Get the custom event description
      Returns:
      Description
    • getPluginName

      public String getPluginName()
      Get the plugin name of the custom event
      Returns:
      Plugin name
    • getEventName

      public String getEventName()
      Get the event name of the custom event
      Returns:
      Event name
    • addPlaceholder

      public AdditionsEvent addPlaceholder(String arg0, String arg1)
      Add a placeholder to the actions. These will be replaced with the value that you specify.
      Parameters:
      arg0 - Placeholder to be replaced. This will be between percent characters (%%).
      arg1 - Value to be replaced.
    • removePlaceholder

      public AdditionsEvent removePlaceholder(String arg0)
      Remove a placeholder from the placeholder list.
      Parameters:
      arg0 - Placeholder to be removed.
    • getIdentifier

      public String getIdentifier()
      Get the event identifier assigned by the plugin. Commonly, this is plugin-eventname
      Returns:
      event identifier
    • getExtraOptions

      public HashMap<String,​Object> getExtraOptions()
      Get the list of extra event options
      Returns:
      HashMap with the string (identifier) and object (value)
    • getExtraOption

      public Object getExtraOption(String optionIdentifier)
      Get the extra option value of an identifier
      Parameters:
      optionIdentifier - Option identifier
      Returns:
      Object
    • perform

      public void perform(org.bukkit.entity.Player arg0)
      Perform the custom event. Using this method will send the event to our plugin and lets AdditionsPlus handle the actions. A player needs to be specified.
      Parameters:
      arg0 - Player to perform the actions for.