on_player_cursor_stack_changed how it works?

Place to get help with not working mods / modding interface.
Parallel
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Oct 18, 2016 2:39 pm
Contact:

on_player_cursor_stack_changed how it works?

Post by Parallel »

Hello,, everyone.
How exactly works event on_player_cursor_stack_changed:
1 Is it called when player get some item frrom inventory/chest/etc.?
2 Is it called when player moving whoe stack by using ctrl+LeftClick?
3 Is it called when player putting some items to chest without opening it?
4 Is there similar event for manipulators?

The point is to create chest that can contain items only specific type and prevents putting to it other items, including manipulators.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: on_player_cursor_stack_changed how it works?

Post by Nexela »

on_player_cursor_stack_changed is called exactly as its name is implied

It won't be called when ctrl/shift clicking from one inventory to another. It will be called after shift/ctrl clicking an item in your hand to an inventory.

There are other events that can be watched for though.
on_player_main_inventory_changed
on_player_quickbar_inventory_changed
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: on_player_cursor_stack_changed how it works?

Post by aubergine18 »

If you want to see exactly what events are getting fired, I highly recommend Creative Mode mod which has an event logger. You can select one or more events from its UI, and when they fire they'll get logged to console and/or log file (depends what options you set) so you can see exactly what's happening.
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.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: on_player_cursor_stack_changed how it works?

Post by aubergine18 »

Also, this might be of use: memberlist.php?mode=viewprofile&u=25589
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 “Modding help”