[XMaterial] - Incorrect/Inconsistent matchXMaterial(itemstack) result on 1.8.8 & 1.12.2
See original GitHub issueDescription 1. Skeleton Skulls are matching as Dragon Heads on 1.8.8 and Pig Spawn Eggs are matching as Hoglin Spawn Eggs on 1.12.2 Command:
/minecraft:replaceitem entity @p slot.hotbar.0 skull 1 0
For Pig Spawn Egg, it is taken from the Creative Inventory. Code:
ItemStack itemStack = player.getInventory.getItem(0);
XMaterial.matchXMaterial(itemStack);
2. Inconsistency when matching different Dye items on 1.8.8 Using the same code above, in Minecraft 1.8.8: Bone Meal matches into Bone Meal, however Ink Sacs matches into Black Dye
Seems like all of these incorrect/inconsistent matches involves items with 0 damage value, might have to check whether this also effects other similar items like flowers. As for the spawn egg, it might be also be due to how 1.12 uses nbt to determine the mob in contains.
Version 1.8.8, 1.12.2
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Resource - XSeries - XMaterial, XParticle, XSound, XPotion ...
This is used to support block state and data for materials. XMaterial only handles ItemStacks. All the XMaterial exceptional materials for ...
Read more >[XMaterial] - Data not working? · Issue #69 - GitHub
I have a String, like "INK_SACK:8", and when i use XMaterial.matchXMaterial(config.getString("material"); it only loads the ink sack, not the "8 ...
Read more >XSeries - bytemeta
Unsupported material with XMaterial#matchXMaterial(ItemStack) ... [XMaterial] - Incorrect/Inconsistent matchXMaterial(itemstack) result on 1.8.8 & 1.12.2.
Read more >Improve error messages and handling - Olical/Aniseed - IssueHint
... 26, 2022-02-16, 2022-07-03. [XMaterial] - Incorrect/Inconsistent matchXMaterial(itemstack) result on 1.8.8 & 1.12.2, 5, 2022-01-15, 2022-07-25.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I fixed all of them in 8.6.1
Thanks for the fix. It’s fair to say that
SPAWN_EGG_META
are outside the scope of XMaterial hence not supported. Although I feel like a predictable result should still be provided. Like always returning the “default material” (the one with damage0
- i.e.PIG_SPAWN_EGG
) instead of an arbitrary result like theHOGLIN_SPAWN_EGG
.