recipe with barrel with NBT does not work

Started by nl_nl_n on

Topic category: Help with modding (Java Edition)

Last seen on 04:42, 9. Sep 2024
Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
recipe with barrel with NBT does not work

Hi. I want to make barrels with an NBT that I would then use as a condition so that they cannot be opened until after a certain time of having been placed. After this time the NBT would be deleted and some items would be placed inside.
The problem in question is that the recipe stops working when I add the NBT line in the code editor, that is, I put the items but nothing appears as a result.
I was guided by a post called "How To Give A Crafted Item An NBT Tag", I put the code for my barrel here.

 

{
 "type": "minecraft:crafting_shaped",
 "category": "misc",
 "pattern": [
   "aaa",
   "aba",
   "aaa"
 ],
 "key": {
   "a": {
     "item": "minecraft:gold_nugget"
   },
   "b": {
     "item": "minecraft:barrel"
   }
 },
 "result": {
   "item": "minecraft:barrel",
   "count": 1
   "nbt": "{\"TestTag\":\"hello\"}"
 }
}

 

In case anyone suggests it: I'm using a standard Minecraft barrel on a whim, I want to make it completely vanilla if possible. Creating a new block identical to the barrel is an option, but I'll do it only if I can't do it by this method.