PrismarineJS / minecraft-data

Language independent module providing minecraft data for minecraft clients, servers and libraries.
https://prismarinejs.github.io/minecraft-data
650 stars 222 forks source link

why are the block IDs in this package different from the actual minecraft block IDs? #860

Open Jagorrim opened 6 months ago

Jagorrim commented 6 months ago

I've searched actual minecraft blocks IDs, and it differ from IDs in this package. For example: every site about it say that ID of still water is 8, but in this package it is 26. Why is this so? I'm beginner in js and, in particular, in mineflayer, and i don't understand. Sorry for the stupid question, if the question is really like that

extremeheat commented 6 months ago

Minecraft since 1.13 doesn't use static numerical block IDs (see: the flattening). It uses strings to identify blocks. The id field in minecraft-data is for internal representation, the stateId is the block state ID that identifies the specific block state.

I recommend reading pages like https://minecraft.wiki/w/Block_states, https://minecraft.wiki/w/Java_Edition_data_values, https://minecraft.wiki/w/Java_Edition_1.13/Flattening

Jagorrim commented 6 months ago

Thanks!