mojira.dev
MC-81497

difficulty command gets executed at the end of a tick

Relates to:

When using the difficulty command Minecraft performs it at the end of a tick.

How to reproduce:

Example command

/summon MinecartCommandBlock ~ ~1 ~ {Command:/setblock ~ ~-4 ~ redstone_block,Riding:{id:MinecartCommandBlock,Command:"",Riding:{id:MinecartCommandBlock,Command:"
",Riding:{id:MinecartCommandBlock,Command:"/setblock ~5 ~ ~ command_block 0 replace {Command:/fill ~-1 ~ ~ ~-3 ~ ~ redstone_block}
",Riding:{id:MinecartCommandBlock,Command:"/setblock ~4 ~ ~1 command_block 0 replace {Command:/say @e[type=PigZombie]}
",Riding:{id:MinecartCommandBlock,Command:"/setblock ~3 ~ ~1 command_block 0 replace {Command:/summon PigZombie}
",Riding:{id:MinecartCommandBlock,Command:"/setblock ~2 ~ ~1 command_block 0 replace {Command:/difficulty 0}
",Riding:{id:MinecartCommandBlock,Command:"/setblock ~1 ~1 ~ stone_button 5
",Riding:{id:MinecartCommandBlock,Command:"/setblock ~1 ~ ~ command_block 0 replace {Command:/fill ~1 ~ ~ ~3 ~ ~ redstone_block}
",Riding:{id:MinecartCommandBlock,Command:"/difficulty 1
",Riding:{id:MinecartCommandBlock,Riding:{id:FallingSand,Time:1,Block:activator_rail,Riding:{id:FallingSand,Time:1,Block:redstone_block,Riding:{id:FallingSand,Time:1,Block:stone,Riding:{id:FallingSand,Time:1,Block:command_block,TileEntityData:{Command:/fill ~ ~-2 ~ ~ ~3 ~ air},Riding:{id:FallingSand,Time:1,Block:stone,Riding:{id:FallingSand,Time:1,Block:command_block,TileEntityData:{Command:/kill @e[type=MinecartCommandBlock,dy=6]}}}}}}}}}}}}}}}}}}

Linked issues

Comments 1

Not related but duplicate of MC-73881.
It has nothing to do with the /difficulty command : The difficulty is not checked when the mob is spawned, but when the entity is updated (this mean the next tick). This is why you can still "see" the entity for 1 tick.

I don't think it's a bug, but a design choose : The peaceful difficulty doesn't affect mobs, but mobs are affected by peaceful difficulty.

marcono1234

(Unassigned)

Unconfirmed

/difficulty, command, difficulty, tick

Minecraft 1.8.7

Retrieved