In my Minecraft survival server I have a dog named Charles (with a name tag) and I love him very much, but the people on my server are very destructive and I am afraid that when I leave they will kill him. Is there a way with commands to pervent my dog and only my dog from dying to them?

1 Answer 1


You can use /effect to give him resistance level 5. This will prevent him from all damage except void damage, starvations, and extremely strong explosions. (so this won't protect him if they bring in enough explosives).

For Java Edition:

/effect give @e[type=wolf,name=Charles] resistance seconds 5 

For Bedrock Edition:

/effect @e[type=wolf,name=Charles] resistance seconds 4

Replace seconds with the amount of time you want him to be invincible.

  • My issuse with this is it has a time limit and I am not on all day or sometimes not at all, is there a way to make it infunite? Dec 2, 2021 at 15:28
  • 1
    @Pink_killer2 The maximum amount of time (at least in Java Edition) you can give an effect for is 1000000 seconds, or about 11.5 days. It will probably last much longer because it only ticks down when someone is online and close enough to load your dog. If you are on at least once per month or so, then you can simply retype the command to reset the timer.
    – Angelica
    Dec 2, 2021 at 15:59
  • @Angelica thank you so much Dec 2, 2021 at 21:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .