7

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?

2

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.

3
  • 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 '21 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 '21 at 15:59
  • @Angelica thank you so much Dec 2 '21 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.