Entity killed by player procedure trigger

Submitted by WeswePengu on Mon, 11/12/2018 - 00:56
Issue description

Running 1.8.1 (see screenshot)

 

Before updating to 1.8.1 I added a loot system to my mod using procedures, which also sends a message to the player telling them they got something and playing a sound effect as well. What is weird is that the sound effect will play perfectly but no item will be added to the player and no message will be sent to the player. This was working perfectly in 1.8.0 but after updating to 1.8.1 it seems to not work anymore.

Everything is explained through the MCR and Screenshot I attached.

MCR Instructions: Check mod element named: EngramDropEvent

 

Edit: Tried recreating procedure after updating to 1.8.1, made no difference, still an issue.

Edit 2: Added Loot System Procedure for analysis purposes.

Edit 3: Can confirm that "add 1 item to inventory" and "send message to player" events work when trigger is set to "when block is broken" Makes me wonder if the issue is related to trigger types, still remembering "play sound events" work under "when entity is killed" trigger, while "add 1 item to inventory" and "send message to player" events do not work under "when entity is killed" trigger.

Attachment Size
Screenshot showing Procedure232.16 KB 232.16 KB
Procedure in question5.72 KB 5.72 KB

Issue comments

Submitted by Klemen on Mon, 11/12/2018 - 11:35

In 1.8.1 we improved the procedure global trigger to better reflect their names. Now, the entity dependency of this trigger is the entity that is being killed, not the source of the killing. We can add new procedure trigger called Player kills entity, where the entity dependency would be the player, not the entity killed.

You hear the sound of this entity, but the message and items are shown to the entity you kill.

I am changing this to a feature request for a new trigger called Player kills entity. If this is not what you meant, please correct me.

Okay that makes sense to me! Glad to hear its an actual feature and not a bug! Changing this to a feature request is fine with me! Really hope to see this new trigger really soon for the sake of all loot systems!

Thank you very much!

 

Submitted by Klemen on Mon, 11/12/2018 - 17:43

Ok, I will add new procedure trigger called Player kills entity, where the entity dependency would be the player, not the entity killed in the future updates.

Submitted by Klemen on Sat, 11/17/2018 - 12:37

Current workaround:

In the procedure, inside function onEntityAttacked, replace this line:

Entity entity=event.getEntity();

with

Entity entity=event.getSource().getTrueSource();

and the trigger will work as it used in 1.8.0.