on_put_item What Item?
on_put_item What Item?
I'd like to know what item was used when placing an entity, I think it'd be most useful for the on_put_item event, but a second would be the on_built_entity event, although that does not really have to be with an item.
Re: on_put_item What Item?
The item is the item in the players cursor.
If you want to get ahold of me I'm almost always on Discord.
Re: on_put_item What Item?
Oww, so it goes about like this: On put item> on entity build> item taken from cursor?Rseding91 wrote:The item is the item in the players cursor.
Re: on_put_item What Item?
yes.matjojo wrote:Oww, so it goes about like this: On put item> on entity build> item taken from cursor?Rseding91 wrote:The item is the item in the players cursor.
If you want to get ahold of me I'm almost always on Discord.
Re: on_put_item What Item?
Would you mind adding description about this on the doc please?
Edit: oh wait! I think the order above is incorrect.
It should be: on_put_item -> item taken from cursor -> on_built_entity
If the player has spent the last item, cursor stack will be invalid for read in on_built_entity. In that case, it is not possible to know which item was used to build the entity.
Maybe it is related as well: placed_item in on_built_entity/on_robot_built_entity
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: on_put_item What Item?
Well, you do have access to who built the entity, as well as the entity type. Unless you have more than one item definition to place the same entity, it shouldn't be an issue. But in that case, why would you have multiple items to place the same entity type?
Re: on_put_item What Item?
bobingabout wrote:Well, you do have access to who built the entity, as well as the entity type. Unless you have more than one item definition to place the same entity, it shouldn't be an issue. But in that case, why would you have multiple items to place the same entity type?
I'm not really concerned why someone would make it so, i want my nod to work when someone does do it.