Mojira Archive
MCM-1248

Custom block with non-default state when broken creates a Content Log error and drops a useless item

Partner Rank: 2

Partner Team Reporting: Starfish Studios

Verification builds: beta 1.16.200.57
Summary:
Custom block with non-default state when broken creates a Content Log error and drops a useless item that can't be placed.

Impact:
This issue prevents the player from obtaining a custom block that has a non-default property in its default property and then using it again. The Content Log error requests the creator to consider adding a minecraft:loot component to make the dropped item explicit, but when adding, it still causes the error when broken with Silk Touch enchantment, because this enchantment always tries to take the current state of the block to drop it.
Repro Steps:

  1. Download and install the attached add-on pack.
  2. Join a world using survival game mode with the behavior and resource pack enabled, turn on the Creator Holidays Features option.
  3. Give yourself a demo redstone lamp /give @s demo:redstone_lamp_block.
  4. Give yourself a demo soul redstone lamp /give @s demo:soul_redstone_lamp.
  5. Place the redstone lamp and right-click on it, then break it and try to place it again.
  6. Place the soul redstone lamp and right-click on it, then break it and place it again.
  7. Give yourself a pickaxe /give @s diamond_pickaxe.
  8. Enchant it with Silk Touch /enchant @s silk_touch.
  9. Now break the soul redstone lamp with the Silk Touch pickaxe, and try to place it again.

Repro Rate: 3/3

Observed Results:
When breaking the demo redstone lamp or the demo soul redstone lamp with Silk Touch after right-clicking on it, this creates the following Content Log error:

[Blocks][error]-Custom blocks only support default state when dropped. Consider adding a minecraft:loot component to make the dropped item explicit. Returning default state block.

The redstone lamp is without a minecraft:loot component, while the soul redstone lamp has a minecraft:loot component as requested by the Content Log. The item dropped by the block cannot be used until an item with the block default state joins the stack.

Expected Results:
The item should always be dropped with block default state, or when adding a minecraft:loot component always drop the item explicitly even when using Silk Touch, allowing the creator to set the item to Silk Touch using an existing loot table function called silk_touch_enchant.

Screenshots/Videos attached: No

Notes:
I tried to solve this issue using the "silk_touch_enchant" loot_table function, but it doesn't work. Because a custom block is already programmed to drop the block with its current state when being broken with Silk Touch even if it has a minecraft:loot component, but for this the function "silk_touch_enchant" could be used.

Fixed

Jean Lucas

2020-11-25, 09:42 PM

2021-03-05, 08:13 PM

2021-03-05, 08:13 PM

0

0

Future Release

-