Replace a block with a prefilled chest

Started by Neoelfeo on

Topic category: Help with modding (Java Edition)

Last seen on 07:36, 8. Jun 2023
Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Replace a block with a prefilled chest
Sat, 10/23/2021 - 17:21 (edited)

Hello, I am trying to make a block similar to a chest with a padlock, if you have the right item you can right click on the block and it should be replaced by a chest with a loot table in specific.

The problem is, that when putting the command "setblock ~ ~ ~...etc" in a custom code snippet the console tells me that the expression is illegal and does not compile.

How should I do it then?

 

Heres is the code:
 

mcreator\nefrandomstuff\procedure\ProcedureBronceKey.java:27: error: illegal start of expression
/setblock ~ ~ ~ chest 0 replace {Items:[{Slot:6,id:iron_pickaxe,Count:1,tag:{ench:[{id:34,lvl:1}]}},{Slot:8,id:rotten_flesh,Count:1},{Slot:9,id:spider_eye,Count:1},{Slot:13,id:rotten_flesh,Count:1},{Slot:16,id:enchanted_book,Count:1,tag:{StoredEnchantments:[{id:21,lvl:2}]}},{Slot:17,id:spider_eye,Count:1},{Slot:20,id:spider_eye,Count:1},{Slot:22,id:web,Count:6},{Slot:24,id:bow,Count:1,tag:{ench:[{id:34,lvl:3},{id:48,lvl:2}]}},{Slot:25,id:coal,Count:2},{Slot:27,id:cobblestone,Count:26}]}

 

It's for minecraft 1.12.2

Edited by Neoelfeo on Sat, 10/23/2021 - 17:21