Is there a way to add a condition to a ranged attack on my custom entity

Started by the_cubja on

Topic category: Help with MCreator software

Last seen on 15:09, 30. Jan 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there a way to add a condition to a ranged attack on my custom entity

I am making a mod that includes a dragon. The dragon will attack you unless you are holding somthing valuable but I can work out how to apply the condition to the ranged fire attack I made. Is it even possible? Thanks.

Last seen on 21:55, 20. Feb 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You should be able to apply…
Fri, 12/29/2023 - 15:31

You should be able to apply a start and a continue condition in the entity's AI. Make a procedure that returns true or false by checking if the item in the main hand of the entity is tagged as 'valuable.' (Also make a tag for valuable items.) Then use this procedure as the start and continue condition in the entity's AI for attacking the player.