1

I'm making a map in Minecraft. No mods, no Bukkit, no anything; just command blocks. and I have this one mob that I don't want players to be able to kill.

Normally, I would simply give it a resistance potion so that it couldn't be hurt, but I want other mobs to be able to hurt it, just not players.

Is it possible to make this mob unkillable by players, but still able to die by other mobs?

1
  • 1
    What kind of mob do you have here? Knowing how you're implementing the "other mobs damage" thing would be helpful to know. Do you have villagers being attacked by zombies? If so, there's probably a way to do this. I'm thinking something like this to apply damage (or increment a damage score and kill them when it hits a certain number) could work.
    – Unionhawk
    Nov 24, 2014 at 20:57

3 Answers 3

2

You could give the player a really strong weakness status effect if they're within melee range of the mob. This isn't exactly what you're looking for, since the player won't be able to kill any mobs within that region, even ones that they normally would elsewhere. If you're fine with that, then go right ahead.

If you also want it to be immune to player-shot arrows you could add

execute at @e[tag=enemy] run kill @e[type=arrow,distance=..2,nbt={pickup:1b}]

This only affects arrows shot by someone in survival or adventure mode, and not in creative. It also ignores arrows from entities like skeletons or pillagers.

0
/summon ExampleMob ~ ~ ~ {Invulnerable:1}
1
  • 1
    This makes the mob invulnerable to other mobs too.
    – pppery
    Feb 10 at 2:34
-3

I'm sorry to tell you that unkillable mobs isn't possible without mods, even with mods they have a health bar, i dont think i've ever seen an unkillable mob, unless someone simply makes a "no health bar for mobs"

5
  • 1
    Unfortunately this is simply wrong. Command blocks can be used to make mobs invincible, by using Resistance 5 and such. Dec 9, 2014 at 19:42
  • ^^^ not true I've killed a mob with resistance 5 it takes a while but it is possible, also i have maxed out a zombie with everything and it was still killed after i did this, me and my friends open a LAN server to test it out Dec 9, 2014 at 20:35
  • 1
    You can use a command to heal the mob when it gets hurt. It shouldn't be possible to kill a resistance X zombie though. Dec 9, 2014 at 20:48
  • well i guess but like that's still not invincible it's healing it when its health is low but yeah that would work, even though its not invincible it's the closest you can get. Dec 10, 2014 at 22:46
  • 1
    You still have a fundamental misunderstanding on how Minecraft works. You could make a mob with high health and resistance X. MCEdit and other NBT editors let you do this. Jan 7, 2015 at 10:59

You must log in to answer this question.

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