public class ElevatorEvent
extends net.minecraftforge.eventbus.api.Event
Modifier and Type | Class and Description |
---|---|
static class |
ElevatorEvent.Post
Fired after the player has been teleported
|
static class |
ElevatorEvent.Pre
Fired before the player is teleported
Cancelling this event will stop the player from being teleported
|
Modifier and Type | Field and Description |
---|---|
protected net.minecraft.util.math.vector.Vector3d |
destination |
protected boolean |
goingUp |
protected net.minecraft.entity.player.ServerPlayerEntity |
player |
protected net.minecraft.util.math.BlockPos |
targetElevator |
Constructor and Description |
---|
ElevatorEvent(net.minecraft.entity.player.ServerPlayerEntity player,
boolean goingUp,
net.minecraft.util.math.BlockPos targetElevator,
net.minecraft.util.math.vector.Vector3d destination) |
Modifier and Type | Method and Description |
---|---|
net.minecraft.util.math.vector.Vector3d |
getDestination()
Gets the currently selected destination for the player.
|
net.minecraft.entity.player.ServerPlayerEntity |
getPlayer()
Gets the player taking the block
|
net.minecraft.util.math.BlockPos |
getTargetElevatorPos()
Gets location of the target elevator block.
|
boolean |
isGoingUp()
If the player is going up or down
|
void |
setDestination(net.minecraft.util.math.vector.Vector3d destination)
Sets the destination block position.
|
protected final net.minecraft.entity.player.ServerPlayerEntity player
protected final boolean goingUp
protected net.minecraft.util.math.BlockPos targetElevator
protected net.minecraft.util.math.vector.Vector3d destination
public ElevatorEvent(net.minecraft.entity.player.ServerPlayerEntity player, boolean goingUp, net.minecraft.util.math.BlockPos targetElevator, net.minecraft.util.math.vector.Vector3d destination)
@Nullable public net.minecraft.util.math.vector.Vector3d getDestination()
@Nullable public net.minecraft.util.math.BlockPos getTargetElevatorPos()
getDestination()
and setDestination(Vector3d)
should be used to determine where the player will be teleported.public void setDestination(@Nullable net.minecraft.util.math.vector.Vector3d destination)
destination
- The new destinationpublic net.minecraft.entity.player.ServerPlayerEntity getPlayer()
public boolean isGoingUp()