mojira.dev
MC-179531

honey_level in Beehive/nest has different datatype dependent on gamemode.

The bug

This bug report has to do with the BlockDataTag of the beenest or beehive item.

When the nest is broken in Survival via Silk Touch, the BlockDataTag.honey_level tag has type String

However, when broken in Creative (the nest drops as an item if there are bees inside), the tag has type int.

How to reproduce

  1. Place beehive/nest (doesn't matter)

  2. Let bees enter the block (don't need to wait until honey produced, and necessary so that a block is dropped in creative)

  3. Breaking the block in Creative yields a int type

  4. Pick block with NBT in Creative yields a int type

  5. Breaking the block in Survival with silk touch yields an String type.

Comments 5

Can confirm for 20w16a, but I am seeing the reverse:

  • Creative: int

  • Survival: String

The reason for this is that for Creative this is a special case in the playerWillDestroy method, while for Survival it uses the loot table function copy_state which always serializes properties as String.

Thanks for verifying. Just checked, breaking in creative has type int. (this discrepancy makes modding very tricky).

Affects 1.17.1 and 1.18-rc4

You don't need to comment to confirm for versions on your own report.

Howard

(Unassigned)

Confirmed

Block states

1.15.2, 20w16a, 20w18a, 21w05b, 1.17.1, 1.18 Release Candidate 4, 1.18

Retrieved