Im trying to have a command block summon a mob near a player when certain conditions are met (in this case, when they use a bed) but I can't figure out how to do it!
I have : /testfor @a {sleeping:1b}
To detect if the player is sleeping, and this command block is connected to a comparator . Its the summoning part I cant do. I tried
I guess it's 1.8... So you can do a dummy scoreboard objective: "/scoreboard objectives add objective dummy" (Doesn't have to be called "objective")
And then in a clock (Instead of your /testfor command) you can do "/scoreboard players set @a objective 1 {sleeping:1b}"
Then, a comparator which will lead to 2 command:
1. "/execute @a[score_objective_min=1] ~ ~ ~ /summon Zombie"
2. "/scoreboard players set @a objective 0"
I'm trying to do a similar thing. I want to try to give players a safe AFK area, i was going to give them a book that they could write "AFK" into then it would summon a named, invisible armor stand at their location, then teleport them to the safe location, then they can write "UNAFK" (or something along those lines) and be teleported back to the armor stand, then it would kill the armor stand. Would someone be able to help? And if there is an easier way (im sure there is) please let me know that too.
hi im doing a projet of a similar manner but instead of having the mob spawn at the slepping player i would like it to spawn at a player who has night vision
I guess it's 1.8... So you can do a dummy scoreboard objective: "/scoreboard objectives add objective dummy" (Doesn't have to be called "objective")
And then in a clock (Instead of your /testfor command) you can do "/scoreboard players set @a objective 1 {sleeping:1b}"
Then, a comparator which will lead to 2 command:
1. "/execute @a[score_objective_min=1] ~ ~ ~ /summon Zombie"
2. "/scoreboard players set @a objective 0"
I hope I helped... Good luck!
The same thing, but replace {sleeping:1b} with {ActiveEffects:[{Id:16b}]}:
Im trying to have a command block summon a mob near a player when certain conditions are met (in this case, when they use a bed) but I can't figure out how to do it!
I have : /testfor @a {sleeping:1b}
To detect if the player is sleeping, and this command block is connected to a comparator . Its the summoning part I cant do. I tried
/summon zombie @a {sleeping:1b}
But I get as feedback : Unable to summon object
Would anyone be able to help me? Thanks!
when specifying an entity with NBT data, don't use a space and use straight brackets.
/summon Zombie @a[sleeping:1b]
hope that helped!
And then in a clock (Instead of your /testfor command) you can do "/scoreboard players set @a objective 1 {sleeping:1b}"
Then, a comparator which will lead to 2 command:
1. "/execute @a[score_objective_min=1] ~ ~ ~ /summon Zombie"
2. "/scoreboard players set @a objective 0"
I hope I helped... Good luck!
It's a 1.8 feature. You otherwise cannot summon a mob at a players' location.
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/
What is the exact command you're using and what is the exact error?
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/
No it would not. You cannot directly insert NBT data into player selectors; you must use the method naor2013 posted above.
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/
I'm trying to do a similar thing. I want to try to give players a safe AFK area, i was going to give them a book that they could write "AFK" into then it would summon a named, invisible armor stand at their location, then teleport them to the safe location, then they can write "UNAFK" (or something along those lines) and be teleported back to the armor stand, then it would kill the armor stand. Would someone be able to help? And if there is an easier way (im sure there is) please let me know that too.
hi im doing a projet of a similar manner but instead of having the mob spawn at the slepping player i would like it to spawn at a player who has night vision
ive tryed /execute @a[effect:night_vision] ~ ~ ~ summon Zombie but i get the error the entity UUID provided is in an invalid format
The same thing, but replace {sleeping:1b} with {ActiveEffects:[{Id:16b}]}:
Feel free to ask *almost* anything.