Class TeleportItemEvent.Pre

java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.TeleportItemEvent
com.pixelmonmod.pixelmon.api.events.TeleportItemEvent.Pre
Enclosing class:
TeleportItemEvent

public static class TeleportItemEvent.Pre extends TeleportItemEvent
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. Canceling the event prevents the teleport from occurring, and prevents the item from being consumed.
  • Constructor Details

    • Pre

      public Pre(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

    • setLevel

      public void setLevel(String level)
      Parameters:
      level - - The level you would like the player to teleport to
    • setTeleportPosition

      public void setTeleportPosition(net.minecraft.core.BlockPos teleportPosition)
      Parameters:
      teleportPosition - - The Blockpos to teleport the player to
    • setConsumeItem

      public void setConsumeItem(boolean consumeItemStack)
      Parameters:
      consumeItemStack - - If the item should be consumeed on use
    • setTeleportToSpawnpoint

      public void setTeleportToSpawnpoint(boolean teleportToSpawnpoint)
      Parameters:
      teleportToSpawnpoint - - If the location should be overriden and the item should teleport a user to their spawnpoint