Class TeleportItemEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.TeleportItemEvent
- Direct Known Subclasses:
TeleportItemEvent.Post
,TeleportItemEvent.Pre
public class TeleportItemEvent
extends net.minecraftforge.eventbus.api.Event
TeleportItemEvent is called when a TeleportItem is used, namely for things like Escape Rope, and the Ultra space and
Drowned world teleporters
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Fired after the player has been teleported using an itemstatic class
Fired before the teleport occurs, Level, Position and if the item is consumed can be set here to modify where the item teleports the player.Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected net.minecraft.world.item.ItemStack
protected String
protected net.minecraft.world.entity.player.Player
protected net.minecraft.core.BlockPos
protected boolean
-
Constructor Summary
ConstructorDescriptionTeleportItemEvent
(net.minecraft.world.item.ItemStack item, net.minecraft.world.entity.player.Player player, String level, net.minecraft.core.BlockPos teleportPosition, boolean consumeItemStack, boolean teleportToSpawnpoint) -
Method Summary
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
itemStack
protected net.minecraft.world.item.ItemStack itemStack -
player
protected net.minecraft.world.entity.player.Player player -
level
-
teleportPosition
protected net.minecraft.core.BlockPos teleportPosition -
consumeItemStack
protected boolean consumeItemStack -
teleportToSpawnpoint
protected boolean teleportToSpawnpoint
-
-
Constructor Details
-
TeleportItemEvent
public TeleportItemEvent(net.minecraft.world.item.ItemStack item, net.minecraft.world.entity.player.Player player, String level, net.minecraft.core.BlockPos teleportPosition, boolean consumeItemStack, boolean teleportToSpawnpoint)
-
-
Method Details
-
getItemStack
public net.minecraft.world.item.ItemStack getItemStack()- Returns:
- The itemstack causing the teleport
-
getPlayer
public net.minecraft.world.entity.player.Player getPlayer()- Returns:
- The player trying to be teleported
-
getLevel
- Returns:
- The level the player is being teleported to
-
getActualLevel
- Returns:
- The actual level the player is being teleported to.
-
getTeleportPosition
public net.minecraft.core.BlockPos getTeleportPosition()- Returns:
- The position in the world the player is being teleported to
-
shouldConsumeItemStack
public boolean shouldConsumeItemStack()- Returns:
- If the itemstack should be consumed on use
-
shouldTeleportToSpawnpoint
public boolean shouldTeleportToSpawnpoint()- Returns:
- If the player should be teleported to their spawnpoint instead - Overrides any position or world arguments.
-