Is it possible to testfor a player (with a specific scoreboard value) with the saturation effect? If so, do tell; If not, i need some help as well.
Im trying to thematically cure someone of a disease, so optimally id love for them to drink the potion, then when they have a placeholder potion effect (like saturation or blindness), cure them. I haven't found a way for that to be possible, so id like a testfor command to see if a player has a specific potion in their inventory. The (incomplete) give command:
Id love for the saturation effect to be hidden and have lore that says "Can be used to rid the plague", also a golden name would be amazing if possible)
For some reason the duration is automatically set to 0 no matter what value I enter, that needs to be fixed >.<
give minecraft:potion 1 8267 {CustomPotionEffects:[{Id:23,Amplifier:[0],Duration:[100]}],display:{Name:"Plague Cure"}}
If someone could write a testfor command looking for someone with that potion, or preferentially a testfor looking for someone with a x score of 2 and a saturation effect, id be very very grateful, thanks!
EDIT: Additional question, is there a way to select a random mob with @r for scoreboard operation? I tried setting them to a score then operating on @r with the score, but it didn't work.
Is it possible to testfor a player (with a specific scoreboard value) with the saturation effect? If so, do tell; If not, i need some help as well.
Im trying to thematically cure someone of a disease, so optimally id love for them to drink the potion, then when they have a placeholder potion effect (like saturation or blindness), cure them. I haven't found a way for that to be possible, so id like a testfor command to see if a player has a specific potion in their inventory. The (incomplete) give command:
Id love for the saturation effect to be hidden and have lore that says "Can be used to rid the plague", also a golden name would be amazing if possible)
For some reason the duration is automatically set to 0 no matter what value I enter, that needs to be fixed >.<
If someone could write a testfor command looking for someone with that potion, or preferentially a testfor looking for someone with a x score of 2 and a saturation effect, id be very very grateful, thanks!
EDIT: Additional question, is there a way to select a random mob with @r for scoreboard operation? I tried setting them to a score then operating on @r with the score, but it didn't work.
Note that this requires being in 1.8. You can check their "ActiveEffects" tag:
/testfor @a[score_x_min=2] {ActiveEffects:[{Id:23b}]}
or
/scoreboard players set @a[score_x_min=2] OBJECTIVE 1 {ActiveEffects:[{Id:23b}]}
The /scoreboard command would allow you to target the correct player instead of using /testfor.
For your potion, you can use the "HideFlags" bitfield tag to hide specific tooltips on items. Setting the value to 32 would hide potion effects (among other various tooltips). The full list can be found on the wiki: http://minecraft.gamepedia.com/Player.dat#Display_Properties
The "Amplifier" and "Duration" tags are not list-types, so you don't encase their data in square brackets. "Amplifier" is a 'byte' while "Duration" is an 'integer', in which both are simply numbers that have differing maximum and minimum values. Note that "Duration" is the time in ticks (20t/s), in which the effect will last 5 seconds:
For your last question: unfortunately there is no direct way to target a random entity.
For this, I'm scanning random mobs (might not have to be random), seeing how many are near them, then executing commands if there are say, 10 mobs within 2 blocks of it. Is there any conceivable way to do this?
For this, I'm scanning random mobs (might not have to be random), seeing how many are near them, then executing commands if there are say, 10 mobs within 2 blocks of it. Is there any conceivable way to do this?
Unfortunately that may be a bit complicated. You'll have to use CommandStats as well to determine the number of nearby entities, as a simple /testfor on an execute only returns a signal strength of 1, regardless of how many entities are found. CommandStats would supply the correct amount, as well as support multiple entities to be tested.
Prerequisites:
Objective to eventually hold the number of entities:
/scoreboard objectives add ENTITIES dummy
Commands:
The following must be run on a clock to instantiate new entities into the scoreboard:
Summary:
When the /testfor command is executed on an entity, the entitys' "ENTITIES" score will be set equal to the 'SuccessCount' of the command. So if the /testfor finds 6 entities nearby, their "ENTITIES" score will be set to 6. Of course, it will count the initiating entity as well, so you'll have to check for a score of 11 rather than 10. The following will say the names of entities who have 10 or more within 2 blocks of them:
Het bro, I need help on this topic as well. So I am trying to make a Zombe Survival Server for me and my friends. You are Infected and have 100 Days until you die (Gamemode 3). However, if you use the custom crafter and make the "Medicine" for this Infection you lose 10 days. I have figured out all the background things, but for some reason my command that detects if the player has the Health Boost Effect and adds a score to the "cure" scoreboard to activate everything will not work. Here is the command:
/scoreboard players set @a cure 1 {ActiveEffects:[{id:21b}]}
Thanks for the help brah.
Im trying to thematically cure someone of a disease, so optimally id love for them to drink the potion, then when they have a placeholder potion effect (like saturation or blindness), cure them. I haven't found a way for that to be possible, so id like a testfor command to see if a player has a specific potion in their inventory. The (incomplete) give command:
If someone could write a testfor command looking for someone with that potion, or preferentially a testfor looking for someone with a x score of 2 and a saturation effect, id be very very grateful, thanks!
EDIT: Additional question, is there a way to select a random mob with @r for scoreboard operation? I tried setting them to a score then operating on @r with the score, but it didn't work.
Note that this requires being in 1.8. You can check their "ActiveEffects" tag:
The /scoreboard command would allow you to target the correct player instead of using /testfor.
For your potion, you can use the "HideFlags" bitfield tag to hide specific tooltips on items. Setting the value to 32 would hide potion effects (among other various tooltips). The full list can be found on the wiki: http://minecraft.gamepedia.com/Player.dat#Display_Properties
The "Amplifier" and "Duration" tags are not list-types, so you don't encase their data in square brackets. "Amplifier" is a 'byte' while "Duration" is an 'integer', in which both are simply numbers that have differing maximum and minimum values. Note that "Duration" is the time in ticks (20t/s), in which the effect will last 5 seconds:
For your last question: unfortunately there is no direct way to target a random entity.
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/
For this, I'm scanning random mobs (might not have to be random), seeing how many are near them, then executing commands if there are say, 10 mobs within 2 blocks of it. Is there any conceivable way to do this?
Unfortunately that may be a bit complicated. You'll have to use CommandStats as well to determine the number of nearby entities, as a simple /testfor on an execute only returns a signal strength of 1, regardless of how many entities are found. CommandStats would supply the correct amount, as well as support multiple entities to be tested.
Prerequisites:
Objective to eventually hold the number of entities:
Commands:
The following must be run on a clock to instantiate new entities into the scoreboard:
And the following must also be run on a clock to add CommandStats to the entities:
And the big one, an execute command that will force entities to test for nearby entities:
Summary:
When the /testfor command is executed on an entity, the entitys' "ENTITIES" score will be set equal to the 'SuccessCount' of the command. So if the /testfor finds 6 entities nearby, their "ENTITIES" score will be set to 6. Of course, it will count the initiating entity as well, so you'll have to check for a score of 11 rather than 10. The following will say the names of entities who have 10 or more within 2 blocks of them:
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/
/scoreboard players set @a cure 1 {ActiveEffects:[{id:21b}]}
Thanks for the help brah.
OMG its worked thank you so much, i can't wait to tell my friend the server is up!