Interface IServerChunkCacheExtension
public interface IServerChunkCacheExtension
Extension class for
ServerChunkCache
This interface with its default methods allows for easy sending of payloads players watching a specific entity.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
broadcast
(net.minecraft.world.entity.Entity entity, net.minecraft.network.protocol.common.custom.CustomPacketPayload payload) Sends a payload to all players watching the given entity.default void
broadcastAndSend
(net.minecraft.world.entity.Entity entity, net.minecraft.network.protocol.common.custom.CustomPacketPayload payload) Sends a payload to all players watching the given entity.default net.minecraft.server.level.ServerChunkCache
self()
-
Method Details
-
self
default net.minecraft.server.level.ServerChunkCache self() -
broadcastAndSend
default void broadcastAndSend(net.minecraft.world.entity.Entity entity, net.minecraft.network.protocol.common.custom.CustomPacketPayload payload) Sends a payload to all players watching the given entity.If the entity is a player, the payload will be sent to that player.
- Parameters:
entity
- the entity that needs to be watched to receive the payload, and the player to send the payload to if the entity is a player.payload
- the payload to send
-
broadcast
default void broadcast(net.minecraft.world.entity.Entity entity, net.minecraft.network.protocol.common.custom.CustomPacketPayload payload) Sends a payload to all players watching the given entity.If the entity is a player, the payload will
not be sent to that player.- Parameters:
entity
- the entity that needs to be watched to receive the payloadpayload
- the payload to send
-