How can I create a hostile mob that can only be killed with a specific weapon

Started by Jerson123 on

Topic category: Help with modding (Java Edition)

Last seen on 03:23, 11. Apr 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I create a hostile mob that can only be killed with a specific weapon

for example creating a creeper that can only be damaged with the diamond sword, and when hitting it with another weapon such as the iron sword or the gold sword, or the wooden sword, etc. it does not suffer any damage

Last seen on 03:10, 19. Feb 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
use nbt tags I think
Thu, 04/02/2020 - 01:56

use nbt tags I think

Last seen on 03:23, 11. Apr 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No me sirve bro
Fri, 04/03/2020 - 01:03

No me sirve bro

Last seen on 03:23, 11. Apr 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
it does not help me, I would…
Fri, 04/03/2020 - 14:48

it does not help me, I would like you to tell me the specific procedure of how to make a mod only die with a specific article

Last seen on 14:30, 17. Aug 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm not sure, but I think…
Fri, 04/03/2020 - 16:09

I'm not sure, but I think you could make the entity invisible to player attacks in general. For your item, you create a procedure in the "when mob is hit with item" section where you make it so it deals with damage to the provided entity.

Last seen on 07:48, 28. Mar 2024
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think do when The entity…
Sat, 04/04/2020 - 20:32

I think do when The entity is hurt then check if the player has your own sword then heal up to max if it wasn't the right sword