If a player walk on a Iron-Block it shoud change to a Emeral-Block and If he walks on a Emerald-Block it shoud change back to an Iron-Block.
i used this commands:
execute at @p if block ~ ~-1 ~ minecraft:iron_block run setblock ~ ~-1 ~ minecraft:emerald-block and
execute at @p if block ~ ~-1 ~ minecraft:emerald_block run setblock ~ ~-1 ~ minecraft:iron-block in two commandblocks whit setting
Repeat and Always active., Its the same when i used one commandblock with both commands.
But only the first command works. I think the solution is that the block shoud only change when the player wolk on it, and not when he stand on the block. But how looks this command. Or is ther a other solution .
With a clock it works but then u can wait an the block and leave him when its a emerald-block. Thats not the game idea what i wont.
Both commands are working but they replace the blocks so fast that you only see one block type. I would use armor stands as markers to let the commands know not to replace the block until the player steps of and steps on again. To set this up, place down 1 repeating (always active) command block and attach 5 chain (always active, unconditional) command blocks to it (see the included screenshot for the command block layout). Once you've placed all the command blocks, paste these commands in them in order:
execute at @a if block ~ ~-1 ~ minecraft:iron_block unless entity @e[tag=block,distance=..1] run summon minecraft:armor_stand ~ ~ ~ {Tags:["block","set_emerald"],Invisible:1,Marker:1b}
execute at @a if block ~ ~-1 ~ minecraft:emerald_block unless entity @e[tag=block,distance=..1] run summon minecraft:armor_stand ~ ~ ~ {Tags:["block","set_iron"],Invisible:1,Marker:1b}
execute at @e[tag=block,tag=set_emerald,tag=!done] run setblock ~ ~-1 ~ minecraft:emerald_block
execute at @e[tag=block,tag=set_iron,tag=!done] run setblock ~ ~-1 ~ minecraft:iron_block
tag @e[tag=block] add done
execute as @e[tag=block] at @s unless entity @a[distance=..1] run kill @s
This system is a bit buggy when you gave more blocks next to each other but it seems to work quite well for single blocks.
Thanks for the fast answer. It works fine one area of 8*10 blocks. I hop it will works, without lags on a server, when 6 players in different rooms plays this game at the same time.
I now i must modifies the commands for all different teams , but thats not a problem.
HI
This is my idea.
If a player walk on a Iron-Block it shoud change to a Emeral-Block and If he walks on a Emerald-Block it shoud change back to an Iron-Block.
i used this commands:
execute at @p if block ~ ~-1 ~ minecraft:iron_block run setblock ~ ~-1 ~ minecraft:emerald-block and
execute at @p if block ~ ~-1 ~ minecraft:emerald_block run setblock ~ ~-1 ~ minecraft:iron-block in two commandblocks whit setting
Repeat and Always active., Its the same when i used one commandblock with both commands.
But only the first command works. I think the solution is that the block shoud only change when the player wolk on it, and not when he stand on the block. But how looks this command. Or is ther a other solution .
With a clock it works but then u can wait an the block and leave him when its a emerald-block. Thats not the game idea what i wont.
My Maps : 60 challanges [mc 1.8.1][2players] download eng: http://www.mediafire.com/file/ev91qc5f2d61rp4/60_Challanges.rar/file
Both commands are working but they replace the blocks so fast that you only see one block type. I would use armor stands as markers to let the commands know not to replace the block until the player steps of and steps on again. To set this up, place down 1 repeating (always active) command block and attach 5 chain (always active, unconditional) command blocks to it (see the included screenshot for the command block layout). Once you've placed all the command blocks, paste these commands in them in order:
This system is a bit buggy when you gave more blocks next to each other but it seems to work quite well for single blocks.
Command block engineer // Developer // #TeamTrees
Thanks for the fast answer. It works fine one area of 8*10 blocks. I hop it will works, without lags on a server, when 6 players in different rooms plays this game at the same time.
I now i must modifies the commands for all different teams , but thats not a problem.
My Maps : 60 challanges [mc 1.8.1][2players] download eng: http://www.mediafire.com/file/ev91qc5f2d61rp4/60_Challanges.rar/file