Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/18/18 in all areas

  1. You can't directly transform the metadata from a blockstate to a metadata of an ItemStack. For example the metadata of a sideways spruce log would be 5. An itemstack of a log block with a metadata of 5 would be something completely invalid since log metadata for items only goes as high as 3 - as you can see this approach doesn't work since metadata of items and metadata of associated blocks can represent completely different things since as I've said metadata of blocks is only used for serialization. The most accurate solution to getting an ItemStack from a block I can think of is Block#getPickBlock. While it is not 100% accurate(depends on the implementation especially for modded blocks) it is the ItemStack that is associated with middle-clicking that block and in most cases it will be the ItemStack representation of that block with that particular state in the world.
    1 point
  2. 1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.