How to get block entity NBT tags

Started by SnailsAttack on

Topic category: Help with MCreator software

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to get block entity NBT tags
Mon, 11/27/2023 - 00:09 (edited)

I'm trying to detect whether a chest is set to generate a loot table when opened using the following procedure block:

But this command always returns a blank output even if the chest I'm clicking has a loot table set.

How do I retrieve the name of a chest's set loot table?

Edited by SnailsAttack on Mon, 11/27/2023 - 00:09
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I developed the basis for a…
Thu, 11/30/2023 - 13:27

I developed the basis for a workaround. It's a bit awkward but I've tried literally everything else.

You can run the following command with the "/execute" procedure block to record the presence of a specific loot table.

/execute if block ~ ~ ~ minecraft:chest{LootTable:"minecraft:chests/simple_dungeon"} run scoreboard players set @p ss_tag 1

Then you can use the "get entity scoreboard score" procedure block to read whether the test was successful or not.