Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 624 Bytes

protocollib-entity-metadata.md

File metadata and controls

16 lines (11 loc) · 624 Bytes

IProtocolLib Entity Metadata

Pre-1.19, setting a packet's entity metadata values requires setting the desired fields on a (Wrapped)DataWatcher, and assigning that datawatcher (or the packed values, if doing with NMS) to the packet.

With 1.19, the entity metadata protocol changed. Instead of a (Wrapped)DataWatcher, you should create a List of (Wrapped) data values.

ProtocolLib example (1.19+)

PacketContainer container = ...;

List<WrappedDataValue> values = List.of(
  new WrappedDataValue(0, Registry.get(Byte.class), (byte) 0x40)
);

container.getDataValueCollectionModifier().writeSafely(0, values);