testfor cannot test for ActiveEffects because Duration is ticking down
I tried to give a score to players with a specific status effect as well as testing for players with a specific status effect.
However, the commands I used don't ever find a player with the specified NBT Data. /testfor doesn't work as well.
Further testing showed it is the same with mobs.
The commands are:
/scoreboard players set @a canSwim {ActiveEffects:[{Id:17}]}
/testfor @a {ActiveEffects:[{Id:17}]}
Commands for testing purposes:
/scoreboard players set @a canSwim 1 {ActiveEffects:[{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}]}
/testfor @a {ActiveEffects:[{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}]}
EDIT
Since, as Aaron Rhodes said, it might be confusing to see a score name of canSwim and the hunger effect in one command:
I was trying to create a permanent world rule which only lets you swim or dive if you have the hunger effect on you. Otherwise it kills the player trying. It is a part of an ongoing series on YouTube.
EDIT2
Alright, I found a solution, I needed to use "17b" instead of "17". You need to specify the type of the tag. I am not sure if it is intended, however, it is not the bug I posted this issue about. Thank you!
Commands:
/scoreboard players set @a canSwim {ActiveEffects:[{Id:17b}]}
/testfor @a {ActiveEffects:[{Id:17b}]}
Environment
Windows 7 (x86) version 6.1
Java 8.11, Oracle Corporation
Created Issue:
NBT Tags don't work with status effects
I tried to give a score to players with a specific status effect as well as testing for players with a specific status effect.
However, the commands I used don't ever find a player with the specified NBT Data. /testfor doesn't work as well.
Further testing showed it is the same with mobs.
The commands are:
{Id:17}
/scoreboard players set @a canSwim {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/scoreboard players set @a canSwim 1 {ActiveEffects:[]}
{Id:17}
/testfor @a {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/testfor @a {ActiveEffects:[]}
Environment
Windows 7 (x86) version 6.1
Java 8.11, Oracle Corporation
I tried to give a score to players with a specific status effect as well as testing for players with a specific status effect.
However, the commands I used don't ever find a player with the specified NBT Data. /testfor doesn't work as well.
Further testing showed it is the same with mobs.
The commands are:
{Id:17}
/scoreboard players set @a canSwim {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/scoreboard players set @a canSwim 1 {ActiveEffects:[]}
{Id:17}
/testfor @a {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/testfor @a {ActiveEffects:[]}
Since, as Aaron Rhodes said, it might be confusing to see a score name of canSwim and the hunger effect in one command:
I tried to give a score to players with a specific status effect as well as testing for players with a specific status effect.
However, the commands I used don't ever find a player with the specified NBT Data. /testfor doesn't work as well.
Further testing showed it is the same with mobs.
The commands are:
{Id:17}
/scoreboard players set @a canSwim {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/scoreboard players set @a canSwim 1 {ActiveEffects:[]}
{Id:17}
/testfor @a {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/testfor @a {ActiveEffects:[]}
Since, as Aaron Rhodes said, it might be confusing to see a score name of canSwim and the hunger effect in one command:
I tried to give a score to players with a specific status effect as well as testing for players with a specific status effect.
However, the commands I used don't ever find a player with the specified NBT Data. /testfor doesn't work as well.
Further testing showed it is the same with mobs.
The commands are:
{Id:17}
/scoreboard players set @a canSwim {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/scoreboard players set @a canSwim 1 {ActiveEffects:[]}
{Id:17}
/testfor @a {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/testfor @a {ActiveEffects:[]}
Since, as Aaron Rhodes said, it might be confusing to see a score name of canSwim and the hunger effect in one command:
Alright, sorry, Aaron. Here goes the explanation:
I tried to give a score to players with a specific status effect as well as testing for players with a specific status effect.
However, the commands I used don't ever find a player with the specified NBT Data. /testfor doesn't work as well.
Further testing showed it is the same with mobs.
The commands are:
{Id:17}
/scoreboard players set @a canSwim {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/scoreboard players set @a canSwim 1 {ActiveEffects:[]}
{Id:17}
/testfor @a {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/testfor @a {ActiveEffects:[]}
Since, as Aaron Rhodes said, it might be confusing to see a score name of canSwim and the hunger effect in one command:
Alright, sorry, Aaron. Here goes the explanation:I tried to give a score to players with a specific status effect as well as testing for players with a specific status effect.
However, the commands I used don't ever find a player with the specified NBT Data. /testfor doesn't work as well.
Further testing showed it is the same with mobs.
The commands are:
{Id:17}
/scoreboard players set @a canSwim {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/scoreboard players set @a canSwim 1 {ActiveEffects:[]}
{Id:17}
/testfor @a {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/testfor @a {ActiveEffects:[]}
EDIT
Since, as Aaron Rhodes said, it might be confusing to see a score name of canSwim and the hunger effect in one command:I was trying to create a permanent world rule which only lets you swim or dive if you have the hunger effect on you. Otherwise it kills the player trying. It is a part of an ongoing series on YouTube.
I tried to give a score to players with a specific status effect as well as testing for players with a specific status effect.
However, the commands I used don't ever find a player with the specified NBT Data. /testfor doesn't work as well.
Further testing showed it is the same with mobs.
The commands are:
{Id:17}
/scoreboard players set @a canSwim {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/scoreboard players set @a canSwim 1 {ActiveEffects:[]}
{Id:17}
/testfor @a {ActiveEffects:[]}
{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}
/testfor @a {ActiveEffects:[]}
EDIT
Since, as Aaron Rhodes said, it might be confusing to see a score name of canSwim and the hunger effect in one command:I was trying to create a permanent world rule which only lets you swim or dive if you have the hunger effect on you. Otherwise it kills the player trying. It is a part of an ongoing series on YouTube.
I tried to give a score to players with a specific status effect as well as testing for players with a specific status effect.
However, the commands I used don't ever find a player with the specified NBT Data. /testfor doesn't work as well.
Further testing showed it is the same with mobs.
The commands are:
/scoreboard players set @a canSwim {ActiveEffects:[{Id:17}]} /scoreboard players set @a canSwim 1 {ActiveEffects:[{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}]} /testfor @a {ActiveEffects:[{Id:17}]} /testfor @a {ActiveEffects:[{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}]}EDIT
Since, as Aaron Rhodes said, it might be confusing to see a score name of canSwim and the hunger effect in one command:I was trying to create a permanent world rule which only lets you swim or dive if you have the hunger effect on you. Otherwise it kills the player trying. It is a part of an ongoing series on YouTube.
I tried to give a score to players with a specific status effect as well as testing for players with a specific status effect.
However, the commands I used don't ever find a player with the specified NBT Data. /testfor doesn't work as well.
Further testing showed it is the same with mobs.
The commands are:
/scoreboard players set @a canSwim {ActiveEffects:[{Id:17}]} /scoreboard players set @a canSwim 1 {ActiveEffects:[{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}]} /testfor @a {ActiveEffects:[{Id:17}]} /testfor @a {ActiveEffects:[{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}]}EDIT
Since, as Aaron Rhodes said, it might be confusing to see a score name of canSwim and the hunger effect in one command:I was trying to create a permanent world rule which only lets you swim or dive if you have the hunger effect on you. Otherwise it kills the player trying. It is a part of an ongoing series on YouTube.
I tried to give a score to players with a specific status effect as well as testing for players with a specific status effect.
However, the commands I used don't ever find a player with the specified NBT Data. /testfor doesn't work as well.
Further testing showed it is the same with mobs.
The commands are:
/scoreboard players set @a canSwim {ActiveEffects:[{Id:17}]} /testfor @a {ActiveEffects:[{Id:17}]}Commands for testing purposes:
/scoreboard players set @a canSwim 1 {ActiveEffects:[{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}]} /testfor @a {ActiveEffects:[{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}]}EDIT
Since, as Aaron Rhodes said, it might be confusing to see a score name of canSwim and the hunger effect in one command:I was trying to create a permanent world rule which only lets you swim or dive if you have the hunger effect on you. Otherwise it kills the player trying. It is a part of an ongoing series on YouTube.
NBT Tags don't work with status effectstestfor cannot test for ActiveEffects because Duration is ticking down
Yes, indeed, it does. The commands with full ActiveEffects tag (including Duration) were a second measure to see if that outputs a signal. Sadly, it doesn't.
As far as I can see, no commands testing or looking for NBT tags find a mob or player with the specified ActiveEffects tag. The output of command blocks is
The dataTag does not match for [...] or
[...] did not match the required data structure
respectively
I tried to give a score to players with a specific status effect as well as testing for players with a specific status effect.
However, the commands I used don't ever find a player with the specified NBT Data. /testfor doesn't work as well.
Further testing showed it is the same with mobs.
The commands are:
/scoreboard players set @a canSwim {ActiveEffects:[{Id:17}]} /testfor @a {ActiveEffects:[{Id:17}]}Commands for testing purposes:
/scoreboard players set @a canSwim 1 {ActiveEffects:[{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}]} /testfor @a {ActiveEffects:[{Id:17,Amplifier:0,Duration:595,Ambient:0,ShowParticles:1}]}EDIT
Since, as Aaron Rhodes said, it might be confusing to see a score name of canSwim and the hunger effect in one command:I was trying to create a permanent world rule which only lets you swim or dive if you have the hunger effect on you. Otherwise it kills the player trying. It is a part of an ongoing series on YouTube.
EDIT2
Alright, I found a solution, I needed to use "17b" instead of "17". You need to specify the type of the tag. I am not sure if it is intended, however, it is not the bug I posted this issue about. Thank you!Commands:
/scoreboard players set @a canSwim {ActiveEffects:[{Id:17b}]} /testfor @a {ActiveEffects:[{Id:17b}]}
What are you trying to accomplish with these commands? A more detailed explanation would help. The score name of canSwim and the effect of hunger don't seem to go together, so its a little confusing.
Alright, sorry, Aaron. Here goes the explanation:
I was trying to create a permanent world rule which only lets you swim or dive if you have the hunger effect on you. Otherwise it kills the player trying. It is a part of an ongoing series on YouTube.
Now, it can be accomplished if you just track stats of eaten rotten flesh (or putterfish, problems begin with raw chicken) and give players this status effect just in case they didn't get it. However, that is not really what I want to accomplish, only a temporary solution.
The problem is probably Duration:595 in the testfor commands, the duration of the effect ticks down at the players after being applied.
Alright, I found a solution, I needed to use "17b" instead of "17". I am not sure if it is intended, however, it is not the bug I posted this issue about. Thank you!
Well ok. Didn't see that.
Rule of thumb: You always need to provide the data types in testfor commands.
Edit: Yes, this is intended.
Thanks for the help and sorry for bothering.
So just to be sure, the issue is resolved now?
Yes.