Entity Targeting

Started by ObscureBackdrop on Thu, 09/16/2021 - 20:42

Topic category: Help with modding (Java Edition)

Last seen on 20:40, 16. Sep 2021
Joined Apr 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Entity Targeting
Thu, 09/16/2021 - 20:42

I'm trying to make an item that when right-clicked adds slowness and mining fatigue to an entity that has a custom potion effect, but I can't get the program to target the mob that is affected by the custom potion effect.

Last seen on 16:59, 18. Oct 2021
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
have you tried: Get Entity…
Thu, 09/16/2021 - 21:33

have you tried:

Get Entity Iterator in block radius 20 

   if Entity Iterator has Active Potion Effect: YOUR_EFFECT

      do Set Potion Effect TIME to Entity Iterator type: YOUR_EFFECT

   else

     do Send Message "No Entity Was Found" to Source Entity Show In Action Bar: True/False

Last seen on 22:03, 19. Sep 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
and what if i want an entity…
Thu, 09/16/2021 - 22:10

and what if i want an entity to attack the player who has a diamond in his inventory? What conditions do i need?

Last seen on 16:59, 18. Oct 2021
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
well what you could try is…
Fri, 09/17/2021 - 00:24

well what you could try is set entities damage to default 0, and on a trigger that checks if the entity attacked a player, If player has Diamond in inventory, deal NUMBER_OF_DAMGE to player