new `on_dropped_item` event?

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

new `on_dropped_item` event?

Post by aubergine18 »

Currently there's no easy way to determine if a player dropped an item using the Z key.

I have need to detect this situation and either replace item-on-ground entity with something else, or delete it.

Could we get new event when player drops item using Z key?

Event properties would include: player_index, entity (ref to the item-on-ground entity)

Aside: Would it be worth renaming on_picked_up_item to on_player_picked_up_item? (and likewise: on_player_dropped_item)

EDIT: See also: viewtopic.php?f=25&t=33935
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14913
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: new `on_dropped_item` event?

Post by Rseding91 »

I can add that. However, when the player drops an item onto a belt there's no associated item entity so it's going to be blank in that instance.
If you want to get ahold of me I'm almost always on Discord.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: new `on_dropped_item` event?

Post by aubergine18 »

Yup, that's OK :)
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14913
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: new `on_dropped_item` event?

Post by Rseding91 »

Added for 0.15.
If you want to get ahold of me I'm almost always on Discord.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: new `on_dropped_item` event?

Post by aubergine18 »

<3
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Post Reply

Return to “Implemented mod requests”