Class NetworkKubeEvent

java.lang.Object
dev.latvian.mods.kubejs.net.NetworkKubeEvent
All Implemented Interfaces:
KubeEntityEvent, KubeLivingEntityEvent, KubeEvent, KubeLevelEvent, KubePlayerEvent

@Info("Invoked when a network packet is received.\n\nNote that the behaviour of this event is depending on the **script type**.\n\nIn `server_scripts`, this event is invoked on the server side when a packet is received from a client.\n\nIn `client_scripts`, this event is invoked on the client side when a packet is received from the server.\n") public class NetworkKubeEvent extends Object implements KubePlayerEvent
  • Constructor Details

    • NetworkKubeEvent

      public NetworkKubeEvent(net.minecraft.world.entity.player.Player p, String c, @Nullable @Nullable net.minecraft.nbt.CompoundTag d)
  • Method Details

    • getEntity

      @Info("The player that sent the packet. Always `Minecraft.player` in `client_scripts`.") public net.minecraft.world.entity.player.Player getEntity()
      Specified by:
      getEntity in interface KubeEntityEvent
      Specified by:
      getEntity in interface KubeLivingEntityEvent
      Specified by:
      getEntity in interface KubePlayerEvent
    • getChannel

      @Info("The channel of the packet.") public String getChannel()
    • getData

      @Nullable @Info("The data of the packet.") public @Nullable net.minecraft.nbt.CompoundTag getData()