Class StructureSpawnEvent
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionStructureSpawnEvent(Structure structure, org.bukkit.Location location, double rotation, StructureSpawnHolder holder)
Construct a new spawn event. -
Method Summary
Modifier and TypeMethodDescriptionList<org.bukkit.Location>
Get a list of locations for all signs and containers in the structure.static org.bukkit.event.HandlerList
@NotNull org.bukkit.event.HandlerList
org.bukkit.Location
Get the location where the structure spawned.org.bukkit.Location
Get the maximum point of the structure schematic.org.bukkit.Location
Get the minimum point of the structure schematic.double
Get the rotation of the structure.Get the structure that was spawned.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
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
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
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 classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-