Topic category: Help with Minecraft modding (Java Edition)
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!
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.
Could you by chance post an image of these procedures? I am trying to do the same thing and have been fighting for hours with this.