How to make it so a mob can only take damage from a pickaxe?

Started by BerryMods627 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make it so a mob can only take damage from a pickaxe?

I have just started using mcreator and am trying to make a stone statue mob that can only take damage from a pickaxe. When I thought I figured it out I used the pickaxe on the mob and crashed the game. Can anyone tell me what I did wrong?

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
need to make procedure. in…
Thu, 04/06/2023 - 16:57

need to make procedure.

in global triggers set "if entity attacked" then do "if is event target entity sub(type) of" then select that entity

then do "if not is item in main hand of source entity of item type pickaxe"

then do "cancel event that triggered global trigger". that should work if you dont make mistakes in procedure

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you for your help, I…
Thu, 04/06/2023 - 18:37

Thank you for your help, I'll go try to implement it now.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have done the first part,…
Thu, 04/06/2023 - 20:01

I have done the first part, but I can't figure out how to do "if not is item in main hand of source entity of item type pickaxe". I can't find any parts to make it, if I'm doing something wrong or there is something else, I'm supposed to do let me know.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
do "if" then "not" then …
Fri, 04/07/2023 - 06:04

do "if" then "not" then "item in main hand of (source entity) of item type (pickaxe)

"if do" procedure block is in flow control category. "not" procedure block is in logic category. "is of item type" is in item procedures. replace "provided itemstack" with "item in main hand of (source entity)". you can find item in main hand in entity data categrory.then remove event/target entity and place "source entity" that is in "minecraft components" category

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It worked, thank you for…
Fri, 04/07/2023 - 15:34

It worked, thank you for your help. I appreciate that you gave me your time.