Enum Class CustomBlockDataEvent.Reason

java.lang.Object
java.lang.Enum<CustomBlockDataEvent.Reason>
com.jeff_media.customblockdata.events.CustomBlockDataEvent.Reason
All Implemented Interfaces:
Serializable, Comparable<CustomBlockDataEvent.Reason>, Constable
Enclosing class:
CustomBlockDataEvent

public static enum CustomBlockDataEvent.Reason extends Enum<CustomBlockDataEvent.Reason>
Represents the reason for a change of CustomBlockData
  • Enum Constant Details

    • BLOCK_BREAK

      public static final CustomBlockDataEvent.Reason BLOCK_BREAK
      Represents a block being broken by a player
      See Also:
      • BlockBreakEvent
    • BLOCK_PLACE

      public static final CustomBlockDataEvent.Reason BLOCK_PLACE
      Represents a block being replaced by a new block (for example STONE being placed into a TALL_GRASS)
      See Also:
      • BlockPlaceEvent
      • BlockMultiPlaceEvent
    • EXPLOSION

      public static final CustomBlockDataEvent.Reason EXPLOSION
      Represents a block being destroyed by an explosion
      See Also:
      • BlockExplodeEvent
      • EntityExplodeEvent
    • PISTON

      public static final CustomBlockDataEvent.Reason PISTON
      Represents a block being moved by a piston
      See Also:
    • BURN

      public static final CustomBlockDataEvent.Reason BURN
      Represents a block being destroyed by fire
      See Also:
      • BlockBurnEvent
    • ENTITY_CHANGE_BLOCK

      public static final CustomBlockDataEvent.Reason ENTITY_CHANGE_BLOCK
      Represents a block being changed by an entity. An EntityChangeBlockEvent will only trigger removal of CustomBlockData when the block's material changes.

      Example: When a player steps on REDSTONE_ORE, an EntityChangeBlockEvent is called because the BlockState's "lit" tag changes from false to true. However, this will not lead to removal of CustomBlockData because the block's material is still REDSTONE_ORE.

    • FADE

      public static final CustomBlockDataEvent.Reason FADE
      Represents a block being destroyed by melting, etc. A BlockFadeEvent will only trigger removal of CustomBlockData when the block's material changes. The event will not be called for fire burning out.
      See Also:
      • BlockFadeEvent
    • STRUCTURE_GROW

      public static final CustomBlockDataEvent.Reason STRUCTURE_GROW
      Represents a block being changed by a structure (Sapling -> Tree, Mushroom -> Huge Mushroom), naturally or using bonemeal.
      See Also:
      • StructureGrowEvent
    • FERTILIZE

      public static final CustomBlockDataEvent.Reason FERTILIZE
      Represents a block being changed by fertilizing a given block with bonemeal.
      See Also:
      • BlockFertilizeEvent
    • LEAVES_DECAY

      @Deprecated public static final CustomBlockDataEvent.Reason LEAVES_DECAY
      Deprecated.
      Draft API
      Represents leaves decaying. This is currently not called because of performance reasons. In future versions, there will be a method to enable listening to this.
    • UNKNOWN

      public static final CustomBlockDataEvent.Reason UNKNOWN
  • Method Details

    • values

      public static CustomBlockDataEvent.Reason[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CustomBlockDataEvent.Reason valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getApplicableEvents

      @NotNull public @NotNull List<Class<? extends org.bukkit.event.Event>> getApplicableEvents()
      Gets a list of Bukkit Event classes that are associated with this Reason