I'm trying to detect a Creeper that just started ticking. I hooked up these commands to a 20-tick per second clock and made sure that the first command runs first then the second then third:
/scoreboard players set @e[type=Creeper] ticking 1 {Fuse:30}
This command is supposed to set the Creeper's "ticking" score to 1
/execute @e[type=Creeper,score_ticking_min=1] ~ ~ ~ say I'm ticking
This command makes the Creeper that just started ticking say "I'm ticking"
/scoreboard players set @e[type=Creeper,score_ticking_min=1] ticking 0
This command just sets the Creeper's "ticking" score back to 0 so he won't spam the chat
This fails and I'm 100% sure that the problem is the dataTag in first command. I think it has something to do with tag types.
Rollback Post to RevisionRollBack
Give a man a fire and he'll be warm for a day.
Set a man on fire and he'll be warm for the rest of his life.
edit: also add a ignited:1b to make sure they are ignited otherwise ALL creepers will be add, no matter if they are going to explode or not.
New Code: /scoreboard players set @e[type=Creeper] ticking 1 {Fuse:30s,ignited:1b}
The ignited tag is used when the creeper is ignited by a flint and steel, if it blows up because of a player, it will still have ignited:0
What you can do is check if the creeper have the original fuse, which by default is 30. Invert the signal after that.
When the fuse reduce, you should get a signal. For multiplayer support, you might want to add some scoreboard trickery.
Hmm... So {Fuse:30s} detects all non-ticking Creepers. I tried {Fuse:29s} to detect what Creeper really is ticking but for some reason, it doesn't work. So to make sure that the problem wasn't the clock, I hooked up 30 command blocks to the clock and ran them simultaneously. Commands are the same except the [dataTag]: {Fuse:29s}, {Fuse:28s}, {Fuse:27s}.... {Fuse:1s}, and {Fuse:0s}. It would be impossible to miss the ticks left on the fuse.
The commands failed to find the Creeper with a Fuse less than 30.
Next test I did was to summon a plain Creeper, ignite it, then run the command with dataTag {Fuse:30s} while it's ticking. The command was successful which means that while the Creeper is ticking, the Fuse tag never changes. Bug?
Hmm... So {Fuse:30s} detects all non-ticking Creepers. I tried {Fuse:29s} to detect what Creeper really is ticking but for some reason, it doesn't work. So to make sure that the problem wasn't the clock, I hooked up 30 command blocks to the clock and ran them simultaneously. Commands are the same except the [dataTag]: {Fuse:29s}, {Fuse:28s}, {Fuse:27s}.... {Fuse:1s}, and {Fuse:0s}. It would be impossible to miss the ticks left on the fuse.
The commands failed to find the Creeper with a Fuse less than 30.
The Fuse data tag in creeper changes very fast to the point you can't really get a signal/output from it.
Even if you put 30 command block to test it, it won't matter as it checks it separately. The command block detects it, but because it only last for a very short time, you won't get any signal/output from it.
Next test I did was to summon a plain Creeper, ignite it, then run the command with dataTag {Fuse:30s} while it's ticking. The command was successful which means that while the Creeper is ticking, the Fuse tag never changes. Bug?
Hmm... So {Fuse:30s} detects all non-ticking Creepers. I tried {Fuse:29s} to detect what Creeper really is ticking but for some reason, it doesn't work. So to make sure that the problem wasn't the clock, I hooked up 30 command blocks to the clock and ran them simultaneously. Commands are the same except the [dataTag]: {Fuse:29s}, {Fuse:28s}, {Fuse:27s}.... {Fuse:1s}, and {Fuse:0s}. It would be impossible to miss the ticks left on the fuse.
The commands failed to find the Creeper with a Fuse less than 30.
Next test I did was to summon a plain Creeper, ignite it, then run the command with dataTag {Fuse:30s} while it's ticking. The command was successful which means that while the Creeper is ticking, the Fuse tag never changes. Bug?
The "Fuse" tag is simply stating how long the creeper will take to explode when it enters its explosion phase; the value does store its current span into its explosion. Because of this, there is no way to detect when a creeper has entered this phase while not having been manually ignited with a flint and steel.
Even if you put 30 command block to test it, it won't matter as it checks it separately. The command block detects it, but because it only last for a very short time, you won't get any signal/output from it.
Comparators are not reliable for picking up signals that last 1 tick so I used two commands: /scoreboard sets 1 "ticking" score to the Creeper then /execute @e[score_ticking_min=1] ~ ~ ~ say sssss will confirm that the creeper got the score by making the Creeper chat "sssss".
The "Fuse" tag is simply stating how long the creeper will take to explode when it enters its explosion phase; the value does store its current span into its explosion. Because of this, there is no way to detect when a creeper has entered this phase while not having been manually ignited with a flint and steel.
I see. So currently there's no way to do this.
Thanks to everyone who helped.
Rollback Post to RevisionRollBack
Give a man a fire and he'll be warm for a day.
Set a man on fire and he'll be warm for the rest of his life.
This command is supposed to set the Creeper's "ticking" score to 1
This command makes the Creeper that just started ticking say "I'm ticking"
This command just sets the Creeper's "ticking" score back to 0 so he won't spam the chat
This fails and I'm 100% sure that the problem is the dataTag in first command. I think it has something to do with tag types.
Source: http://minecraft.gam...om/Chunk_format
http://minecraft.gam....com/NBT_Format
edit: also add a ignited:1b to make sure they are ignited otherwise ALL creepers will be add, no matter if they are going to explode or not.
New Code: /scoreboard players set @e[type=Creeper] ticking 1 {Fuse:30s,ignited:1b}
The ignited tag is used when the creeper is ignited by a flint and steel, if it blows up because of a player, it will still have ignited:0
What you can do is check if the creeper have the original fuse, which by default is 30. Invert the signal after that.
When the fuse reduce, you should get a signal. For multiplayer support, you might want to add some scoreboard trickery.
The commands failed to find the Creeper with a Fuse less than 30.
Next test I did was to summon a plain Creeper, ignite it, then run the command with dataTag {Fuse:30s} while it's ticking. The command was successful which means that while the Creeper is ticking, the Fuse tag never changes. Bug?
Even if you put 30 command block to test it, it won't matter as it checks it separately. The command block detects it, but because it only last for a very short time, you won't get any signal/output from it.
Can't seems to replicate this.... not sure.
The "Fuse" tag is simply stating how long the creeper will take to explode when it enters its explosion phase; the value does store its current span into its explosion. Because of this, there is no way to detect when a creeper has entered this phase while not having been manually ignited with a flint and steel.
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/
Comparators are not reliable for picking up signals that last 1 tick so I used two commands: /scoreboard sets 1 "ticking" score to the Creeper then /execute @e[score_ticking_min=1] ~ ~ ~ say sssss will confirm that the creeper got the score by making the Creeper chat "sssss".
I see. So currently there's no way to do this.
Thanks to everyone who helped.