Simply put, you cannot detect when a mob spawner is broken. Even if you managed to detect that, there would be no way of determining what kind of spawner it was. Now for any block that would normally drop an item when "mined" you could use the scoreboard stat.mineBlock type. Since spawners do not drop anything, it would be quite a challenge to accomplish this. One way you might be able to do this is if you check when a player has received a specific amount of XP equal to the amount given from a spawner. A spawner gives 15-43 XP so there will probably be some overlap with other things.
Reasonably, you cannot accomplish this task with command blocks.
As he stated, you cannot do this. If the spawner is at a specific location, you can instead detect if there is air at its location. But you cannot reliably detect when a player breaks any spawner.
Sorry for bringing this back to life but, use this as an example
/scoreboard objectives add Stone stat.mineBlock.minecraft.stone
run that in ur chat
that adds a scoreboard objective, then to testfor it.
testfor @p[score_Stone_min=1]
that in a command block with a fast clock.
I have a cool idea. What if you somehow have an item (lets name it: spawnbreaker) that when you throw it on the spawner, the spawner will break. Then it will summon the Item, (in this case:a mob spawner) on the "spawnbreaker." Then the "spawnbreaker" will be deleted. You could also test for different types of mob spawners too. Hope this helps
I have a cool idea. What if you somehow have an item (lets name it: spawnbreaker) that when you throw it on the spawner, the spawner will break. Then it will summon the Item, (in this case:a mob spawner) on the "spawnbreaker." Then the "spawnbreaker" will be deleted. You could also test for different types of mob spawners too. Hope this helps
BTW I do one command block creations.
This could work with naturally generated spawners, but not custom ones, unless you somehow manage to test the exact NBT data of the spawner first.
You can do that with /blockdata, which can test for the exact NBT data, but Idk how that will convert it into a block... yea It would be tough to figure that out if its possible.
As he stated, you cannot do this. If the spawner is at a specific location, you can instead detect if there is air at its location. But you cannot reliably detect when a player breaks any spawner.
Unless it is an adventure mode map and the player has a wooden pickaxe (for example) that has the CanDestroy tag. Then if that is the only wooden pickaxe you use in the whole map you could testfor the use of a wooden pickaxe because it could only mine mob spawners.
You can do that with /blockdata, which can test for the exact NBT data, but Idk how that will convert it into a block... yea It would be tough to figure that out if its possible.
No, what I mean is that unless you know the exact NBT data of the spawner, you could create a spawner that is similar to the one broken, but not the exact same one. By this I mean, if the spawner has any tiny little modified detail, like spawn range, spawn time, armor, enchantments, etc, you will need a separate command for each possibility. Then a matching command block for each matching possibility. If you don't plan to use this with custom spawners, then this will be easy, as natural spawners always have the same data.
No, what I mean is that unless you know the exact NBT data of the spawner, you could create a spawner that is similar to the one broken, but not the exact same one. By this I mean, if the spawner has any tiny little modified detail, like spawn range, spawn time, armor, enchantments, etc, you will need a separate command for each possibility. Then a matching command block for each matching possibility. If you don't plan to use this with custom spawners, then this will be easy, as natural spawners always have the same data.
You could however, easily copy the NBT data of all naturally generated spawners. I may actually make something to do this. I think it would be cool to be able to make spawner farms in vanilla Minecraft survival worlds.
Well you can modify the NBT data: To copy NBT data of a block, just type "/blockdata x y z {}" in a repeating command block and it will show all of the NBT data of that same block. You can then "modify" it to be different (like, to make it similar) or keep it the same. This could be how you test for custom mob spawners.
Well you can modify the NBT data: To copy NBT data of a block, just type "/blockdata x y z {}" in a repeating command block and it will show all of the NBT data of that same block. You can then "modify" it to be different (like, to make it similar) or keep it the same. This could be how you test for custom mob spawners.
What I meant was to give you the type of mob spawner you mined.(ex. creeper spawner)
You could however, easily copy the NBT data of all naturally generated spawners. I may actually make something to do this. I think it would be cool to be able to make spawner farms in vanilla Minecraft survival worlds.
Right, this is my point. It will be easy with natural spawners.
Right, this is my point. It will be easy with natural spawners.
You might be right, buts it's the same with custom made spawners. You just gotta make the spawners first: This is the setup:
If you look in the command:
The Data of the block should be in the Previous output box. Copy it and paste it in another command block for modification. It could also be used for /setblock. Its really cool to be honest. It even works with entitydata!
Is there even a command block to /give yourself a mob spawner with mob data? Like EntityTag?
I'm gettin there. After that you can use those command blocks (/blockdata x y z {}) to detect under an item. That way you don't have to test for specific coordinates, but the coordinates under the item you throw.
But yea you stated the problem that it would be easy with natural spawners. I see whatcha mean... Yes it would be easier with natural ones because they're already in the world.
I'm gettin there. After that you can use those command blocks (/blockdata x y z {}) to detect under an item. That way you don't have to test for specific coordinates, but the coordinates under the item you throw.
But yea you stated the problem that it would be easy with natural spawners. I see whatcha mean... Yes it would be easier with natural ones because they're already in the world.
No, that is entirely not my point. I'm saying: If you were to throw this mechanism as is into a world, then you would not be able to account for the nearly infinite possibilities of different NBT tags spawners can have (the only thing making it finite, is the variable size limits. Yes, each different value for each different tag would require an entirely new command block with every other possibility as well. Just to account for the "SpawnRange" short AND NOTHING ELSE would take 65,536 command blocks.) So if you are not using this mechanism in turn with specific spawners you will nearly never be able to perfectly copy any spawner.
I am speaking in terms of using this as a tool, not as a gimmick for a mini game, or just simple regular survival.
Please help riphiphip
Thanks if you do!
Simply put, you cannot detect when a mob spawner is broken. Even if you managed to detect that, there would be no way of determining what kind of spawner it was. Now for any block that would normally drop an item when "mined" you could use the scoreboard stat.mineBlock type. Since spawners do not drop anything, it would be quite a challenge to accomplish this. One way you might be able to do this is if you check when a player has received a specific amount of XP equal to the amount given from a spawner. A spawner gives 15-43 XP so there will probably be some overlap with other things.
Reasonably, you cannot accomplish this task with command blocks.
Ok, so how do i testfor this:
"example: /testfot stat.MineBlock.MobSpawner true"
something like that.
but what commands/how do i do it? nigathan
As he stated, you cannot do this. If the spawner is at a specific location, you can instead detect if there is air at its location. But you cannot reliably detect when a player breaks any spawner.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
ok
Sorry for bringing this back to life but, use this as an example
I have a cool idea. What if you somehow have an item (lets name it: spawnbreaker) that when you throw it on the spawner, the spawner will break. Then it will summon the Item, (in this case:a mob spawner) on the "spawnbreaker." Then the "spawnbreaker" will be deleted. You could also test for different types of mob spawners too. Hope this helps
BTW I do one command block creations.
Bob Ross is kool
This could work with naturally generated spawners, but not custom ones, unless you somehow manage to test the exact NBT data of the spawner first.
You can do that with /blockdata, which can test for the exact NBT data, but Idk how that will convert it into a block... yea It would be tough to figure that out if its possible.
Bob Ross is kool
You can use /execute to make a simple spawner mining system:
(Map download at bottom of post if you don't want to have to make it yourself)
The next few commands are numbered and have a map below showing how to arrange them.
0
1
2
3
4
5
Command Block Map:
__________
| .................|
| [4]<[3] ......|
| .\/..../\ .......|
|.[5]..[2]>[1].|
| ....../c\.......|
| ......[0].......|
|_________|
(<,>,/\,\/=Repeater, /c\=Comparator, [#]=Command Block)
And here is an overview and side view of the layout
Or you can use this map download:https://www.dropbox.com/s/j17hq63gz6ta1vp/Spawner.zip?dl=0
Now all you have to do is shift on a spawner to get it!
Check out my YouTube Channel! https://www.youtube.com/channel/UC5xGeY82ipCffJjAu6_kHMQ
Unless it is an adventure mode map and the player has a wooden pickaxe (for example) that has the CanDestroy tag. Then if that is the only wooden pickaxe you use in the whole map you could testfor the use of a wooden pickaxe because it could only mine mob spawners.
Check out my YouTube Channel! https://www.youtube.com/channel/UC5xGeY82ipCffJjAu6_kHMQ
No, what I mean is that unless you know the exact NBT data of the spawner, you could create a spawner that is similar to the one broken, but not the exact same one. By this I mean, if the spawner has any tiny little modified detail, like spawn range, spawn time, armor, enchantments, etc, you will need a separate command for each possibility. Then a matching command block for each matching possibility. If you don't plan to use this with custom spawners, then this will be easy, as natural spawners always have the same data.
You could however, easily copy the NBT data of all naturally generated spawners. I may actually make something to do this. I think it would be cool to be able to make spawner farms in vanilla Minecraft survival worlds.
Check out my YouTube Channel! https://www.youtube.com/channel/UC5xGeY82ipCffJjAu6_kHMQ
Well you can modify the NBT data: To copy NBT data of a block, just type "/blockdata x y z {}" in a repeating command block and it will show all of the NBT data of that same block. You can then "modify" it to be different (like, to make it similar) or keep it the same. This could be how you test for custom mob spawners.
Bob Ross is kool
What I meant was to give you the type of mob spawner you mined.(ex. creeper spawner)
Check out my YouTube Channel! https://www.youtube.com/channel/UC5xGeY82ipCffJjAu6_kHMQ
Right, this is my point. It will be easy with natural spawners.
You might be right, buts it's the same with custom made spawners. You just gotta make the spawners first: This is the setup:
If you look in the command:
The Data of the block should be in the Previous output box. Copy it and paste it in another command block for modification. It could also be used for /setblock. Its really cool to be honest. It even works with entitydata!
Is there even a command block to /give yourself a mob spawner with mob data? Like EntityTag?
Bob Ross is kool
Sure. If you made them.. You are completely ignoring what I'm saying.
I'm gettin there. After that you can use those command blocks (/blockdata x y z {}) to detect under an item. That way you don't have to test for specific coordinates, but the coordinates under the item you throw.
But yea you stated the problem that it would be easy with natural spawners. I see whatcha mean... Yes it would be easier with natural ones because they're already in the world.
Bob Ross is kool
No, that is entirely not my point. I'm saying: If you were to throw this mechanism as is into a world, then you would not be able to account for the nearly infinite possibilities of different NBT tags spawners can have (the only thing making it finite, is the variable size limits. Yes, each different value for each different tag would require an entirely new command block with every other possibility as well. Just to account for the "SpawnRange" short AND NOTHING ELSE would take 65,536 command blocks.) So if you are not using this mechanism in turn with specific spawners you will nearly never be able to perfectly copy any spawner.
I am speaking in terms of using this as a tool, not as a gimmick for a mini game, or just simple regular survival.