"User" and "Target" dependencies

Upvotes: 2
Issue description

Some procedure triggers like "when entity hit with item", "when mob/player collides this entity", "when player hit with bullet" could use two entities as dependency rather than just one.

For example, in the "when entity hit with item", the "user" is the player that uses the item and the "target" is the entity hit with the item. This way it would be possible to do something like this:

(When mob/player hit with item:)

If has (user) in inventory item (mana)

Do

   Add potion effect (poison) to (target)

   Remove item (mana) from (user)

 

Of course these dependencies could only be used with compatible triggers, like the others. Otherwise they will simply stay "entity" like default.

This isn't very important but would make events more dynamic.

Issue comments

Submitted by Klemen on Sun, 12/23/2018 - 10:00

This is a very nice idea, but I am not sure how to implement this in UI. Right now, entity blocks automatically add new dependency entity. If we wanted to add support for multiple entities, there would need to be some kind of selector on which entity to use or two types of block depending on the target.

I will think on how to implement this and I also accept ideas here. But we will definitely implement this in later updates.

Maybe for each event you add a define parameter to show which entity values will be changed/returned from.