Need a way to specify “event/target entity” as the player

Started by chigen123 on

Topic category: Help with MCreator software

Last seen on 00:29, 16. Jan 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Need a way to specify “event/target entity” as the player

I’m trying to write a procedure so that effects are applied when an item is held in the offhand, but it doesn’t work and says that I need to resolve the dependency of “entity”. I’m very new to this software, and I was wondering if anyone could help.

The current code is: 

if item in off-hand of event/target entity=golden seed

do 

Add potion slow_falling with level 1 for 60 ticks to event/target entity

Add potion weakness with level 1 for 60 ticks to event/target entity

Last seen on 18:06, 24. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can use event/target…
Tue, 10/31/2023 - 21:50

You can use event/target entity to target the player. If it says it can't resolve the dependency of 'entity,' it means the trigger you're using doesn't provide an entity, or you changed the procedure to require an entity when it originally didn't. This problem can come up a lot if you're using lots of locked procedures or procedures calling each other, since you have to make sure you're always using a trigger that provides everything the procedure needs to run. (Again, in this case, one of your procedures apparently isn't being provided an entity to target, but references one in the code.)

Just make sure your procedure is either being run through the item-in-inventory tick trigger, or uses the global 'on player update tick' trigger, as both of these provide the player as the event/target entity.

If it's still not working, I can send you a screenshot of an example procedure. (If it'll help.)

Last seen on 00:29, 16. Jan 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you! I didn’t know how…
Wed, 11/01/2023 - 15:19

Thank you! I didn’t know how to set the trigger, so that helps out a lot and the mod is working now.