Monster Spawner Silk Touch?

Started by marshydo on Wed, 01/27/2021 - 19:01

Topic category: Help with modding (Java Edition)

Last seen on 03:33, 18. Feb 2021
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Monster Spawner Silk Touch?
Wed, 01/27/2021 - 19:01

Hello, I am trying to add a feature where I can harvest a monster spawner with a tool/enchantment, (either or it doesn't really matter) right now I am using the "When block destroyed with tool" trigger. The problem I got right now is that I can't get the type of monster in the spawner. I've tried the "get NBT tag of block" but no matter what path or tag type I use, I can't get anything to work. I'm no expert with NBT data but I know that you can find/set the monster being spawned through the blocks NBT data ( for example SpawnData:{id:} ) but I'm not sure how or even if I can get that using MCreator. I'm pretty sure I know what I would do after this to allow you to place the spawner, but this step comes first. If anyone has an idea to help with this it would be greatly appreciated!

Last seen on 15:41, 14. Apr 2021
Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
In block procedures, but…
Wed, 02/24/2021 - 07:09

In block procedures, but also in entities and items, there are procedures that take the NBT and also allow you to change it. (check the Minecraft wiki site to get the accurate NBTs of the spawners). So you just need to use the global trigger "when a block is broken", detect that the broken block is a spawner and use the procedure "execute command at xyz" (as if the mod itself were a normal Minecraft command block) so as to get a spawner in the form of normal as an item with the mob's NBT tag inside. Now I don't know what the command is to spawn an item with NBT so always look for it on the wiki.