#Entity metadata
1 messages ยท Page 1 of 1 (latest)
okay ๐
And I'll have to write a full explanation here
You need to split your logic into multiple packets
Notice how this format is for the entity metadata packet?
Well you shouldn't try writing it in the spawn packet
that's my guide..
In 1.19+ I wouldn't recommend the EasyMetadataPacket utility class
Because you can do it natively
it doesn't exist...
on the gist ?
Read the comments
That's enough for you to work with
okay thanks ๐
hum
another thing
how can I attach the metadata to the entity ?
oh found packet.getIntegers().write(0, entityId);
thanks for all 
My server will no longer burn with my customBlocks
really ? x)
oh well
yellow on white isn't easy to see 
I got no clue which one of my guides that is
Found it nvm
I got 3 packet guides
looks fine on black
how do you make it black ? with an extension ?
Yeah
Update protocollib
okay
okay thanks
so, I "made" this:```java
public static void sendMetadataPacket(int entityId){
// https://wiki.vg/Entity_metadata#Entity_Metadata_Format
PacketContainer metadata = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
List<WrappedDataValue> dataValues = List.of(
new WrappedDataValue(11, WrappedDataWatcher.Registry.get(Vector3f.class), new Vector3f(1.0002f, 1.0002f, 1.0002f)),
new WrappedDataValue(12, WrappedDataWatcher.Registry.get(Quaternionf.class), new Quaternionf(0.0f, 0.0f, 0.0f, 1.0f)),
new WrappedDataValue(13, WrappedDataWatcher.Registry.get(Quaternionf.class), new Quaternionf(0.0f, 0.0f, 0.0f, 1.0f)),
new WrappedDataValue(15, WrappedDataWatcher.Registry.get(Object.class), (15 << 4) | (15 << 20)),
new WrappedDataValue(22, WrappedDataWatcher.Registry.get(Integer.class), octalToDecimal("01010100"))
);
metadata.getIntegers().write(0, entityId);
metadata.getDataValueCollectionModifier().write(0, dataValues);
ProtocolLibrary.getProtocolManager().broadcastServerPacket(metadata);
}```
let's try ๐ค
idk what I need to put (is it an Integer ?)
okay
what does it say on the metadata format
in quotes ?
15 VarInt Brightness override (blockLight << 4 | skyLight << 20) -1
so it is an Integer ?
So yeah it's an int
I did this at 1A.M yesterday, looks like I was sleepy
like this ?java new WrappedDataValue(22, WrappedDataWatcher.Registry.get(Integer.class), "0b01010100")
why are you passing a string
idk...
Yeah you got no clue
This is part of the java basics
๐
But numbers in java are represented in a few ways
that's why idk
I know double, float, int and byte
12345 (decimal)
0xAF (hex)
0123123 (octal, starts with a 0)
0b101010101 (binary)
yes
but with a b wtf
hum ?
yes thanks
Well, idk why but it does nothing @lost ruin
https://paste.md-5.net/hosokojufa.java