Is it possible to insert a condition (for example:"[score_Condition_min=1]") into a "summon" on an "effect" command?
/summon Creeper [score_Condition_min=1] ~ ~1 ~
/effect @p[score_Condition_min=1] 1 2 20
OK, these were my dumb attempts, and don't work, of course, but there must be a way to make them right! (In the case of the "effect" command, I'd like the player WHO PUSHES the button that activates the command block to have 1 point, not the target player)
Any help appreciated, it would be really important!
Thanks in advance,
KGold
/summon Creeper [score_Condition_min=1] ~ ~1 ~
/effect @p[score_Condition_min=1] 1 2 20
OK, these were my dumb attempts, and don't work, of course, but there must be a way to make them right! (In the case of the "effect" command, I'd like the player WHO PUSHES the button that activates the command block to have 1 point, not the target player)
Any help appreciated, it would be really important!
Thanks in advance,
KGold
1
you just need to use the new /execute command! go check the syntax on the wiki: http://minecraft.gamepedia.com/Commands
If your condition is can be put after a variable (e.g. @p) like you showed, you can use the /execute command. If your condition is something like: have a diamond block there, or something more "material", you need a cmd block, with a comparator that aim into another cmd block with your /summon command. Just remeber that the only way to summon/setblock/do any command like this relative to a player/entity, you NEED to use /execute.
by using your example, the execute command could look like this:
the /execute command makes it like the entity targeted (@p[condition] in this case) is the one that do the command. that's why my example with /effect target the player himself.
Hope it helped!
If your condition is can be put after a variable (e.g. @p) like you showed, you can use the /execute command. If your condition is something like: have a diamond block there, or something more "material", you need a cmd block, with a comparator that aim into another cmd block with your /summon command. Just remeber that the only way to summon/setblock/do any command like this relative to a player/entity, you NEED to use /execute.
by using your example, the execute command could look like this:
/execute @p[score_Condition_min=1] ~ ~ ~ /summon Creeper ~ ~1 ~
/execute @p[score_Condition_min=1] ~ ~ ~ /effect @p 1 2 20the /execute command makes it like the entity targeted (@p[condition] in this case) is the one that do the command. that's why my example with /effect target the player himself.
Hope it helped!
