• 1

    posted a message on command to stop animals from drowning?

    There are 2 ways to do this.


    1. You can give them an effect with /effect. I would suggest using resistance but regeneration will also work (aside from the hurt animations). If you only want to stop them from drowning but nothing else you can use water breathing.


    In 1.13+ the command would be

    /effect give <entitys> <effect> 1000000 255 true

    E.g. all pigs should have water breathing:

    /effect give @e[type=pig] water_breathing 1000000 255 true

    In 1.12, I think you only have to remove the "give".


    The disadvantage of this method is that it will not last forever. 1.000.000 seconds are about 11,5 days, this is normally enough for a singleplayer world but on a server you have to renew the effect every 11 days.


    2. You can make the animals invulnerable if you spawn them with a command.

    /summon minecraft:pig ~ ~ ~ {Invulnerable:1b}
    Posted in: Commands, Command Blocks and Functions
  • 1

    posted a message on 1.14.4 Help with detecting when a certain player is on a certain block. /execute
    execute as @p at @s if block ~ ~-1 ~ <block> run <command>

    execute as @p[gamemode=adventure] at @s if block ~ ~-1 ~ <block> run gamemode survival @s
    Posted in: Commands, Command Blocks and Functions
  • To post a comment, please or register a new account.