Class PlayerPositionPacket

All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload
Direct Known Subclasses:
RingOfFirePacket

public abstract class PlayerPositionPacket extends PacketCodec
An abstract superclass for all packets that contain the position and uuid of a player and execute a specific action on the client side that is visible by all players in a specific range around the given player.
  • Field Details

    • uuid

      protected String uuid
    • position

      protected net.minecraft.world.phys.Vec3 position
  • Constructor Details

    • PlayerPositionPacket

      public PlayerPositionPacket(net.minecraft.resources.ResourceLocation id)
      Creates a packet with no content
    • PlayerPositionPacket

      public PlayerPositionPacket(net.minecraft.resources.ResourceLocation id, net.minecraft.world.entity.player.Player player)
    • PlayerPositionPacket

      public PlayerPositionPacket(net.minecraft.resources.ResourceLocation id, net.minecraft.world.entity.player.Player player, int range)
  • Method Details

    • isAsync

      public boolean isAsync()
      Specified by:
      isAsync in class PacketBase
      Returns:
      If this packet can run on a thread other than the main-thread of Minecraft. If this is asynchronous, the player parameter inside the action is not guaranteed to be defined.
    • actionClient

      public void actionClient(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player)
      Description copied from class: PacketBase
      Actions for client-side.
      Specified by:
      actionClient in class PacketBase
      Parameters:
      level - The world.
      player - The player. Can be null if this packet is asynchronous.
    • actionServer

      public void actionServer(net.minecraft.world.level.Level level, net.minecraft.server.level.ServerPlayer player)
      Description copied from class: PacketBase
      Actions for server-side.
      Specified by:
      actionServer in class PacketBase
      Parameters:
      level - The world.
      player - The player.
    • create

      protected abstract PlayerPositionPacket create(net.minecraft.world.entity.player.Player player, int range)
    • getModInstance

      protected abstract ModBase getModInstance()
    • performClientAction

      protected abstract void performClientAction(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player)