Class StructureSpawnEvent

java.lang.Object
org.bukkit.event.Event
com.ryandw11.structure.api.StructureSpawnEvent

public class StructureSpawnEvent extends org.bukkit.event.Event
This event is called every time a structure spawns. Use this event like any other Bukkit event.

This is called after the plugin does all of its primary operations, such as block replacement, loot tables, etc.

It is not possible to cancel this event.

  • Constructor Details

    • StructureSpawnEvent

      public StructureSpawnEvent(Structure structure, org.bukkit.Location location, double rotation, StructureSpawnHolder holder)
      Construct a new spawn event.
      Parameters:
      structure - The structure.
      location - The location of the structure.
      rotation - The rotation (in degrees).
      holder - The holder for structure data.
  • Method Details

    • getStructure

      public Structure getStructure()
      Get the structure that was spawned.
      Returns:
      The structure that was spawned.
    • getLocation

      public org.bukkit.Location getLocation()
      Get the location where the structure spawned.

      This is where the origin point of the schematic spawns.

      Returns:
      The location where the structure spawned.
    • getRotation

      public double getRotation()
      Get the rotation of the structure. (In Degrees)
      Returns:
      The rotation of the structure (in degrees).
    • getMinimumPoint

      public org.bukkit.Location getMinimumPoint()
      Get the minimum point of the structure schematic.

      The rotation transformation is already applied.

      Note: This is not guaranteed to be the minimum point if the structure is rotated. Use Math.min() in order to determine the true minimum x, y, and z values.

      Returns:
      The minimum point of the structure schematic.
    • getMaximumPoint

      public org.bukkit.Location getMaximumPoint()
      Get the maximum point of the structure schematic.

      The rotation transformation is already applied.

      Note: This is not guaranteed to be the maximum point if the structure is rotated. Use Math.min() in order to determine the true maximum x, y, and z values.

      Returns:
      The maximum point of the structure schematic.
    • getContainersAndSignsLocations

      public List<org.bukkit.Location> getContainersAndSignsLocations()
      Get a list of locations for all signs and containers in the structure.

      Note: Containers may already have a loot table defined.

      Note 2: Not all locations are guaranteed to be either a sign or a container since a sign may have been removed by the plugin in order to spawn a mob or schematic.

      Note 3: All locations already have the rotation transformation applied.

      Returns:
      The list of locations for all signs and containers in the structure.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()