Page 1 of 1

on_player_cursor_stack_changed how it works?

Posted: Wed Nov 02, 2016 3:44 am
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.

Re: on_player_cursor_stack_changed how it works?

Posted: Wed Nov 02, 2016 8:47 am
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

Re: on_player_cursor_stack_changed how it works?

Posted: Wed Nov 02, 2016 5:26 pm
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.

Re: on_player_cursor_stack_changed how it works?

Posted: Wed Nov 02, 2016 5:50 pm
by aubergine18
Also, this might be of use: memberlist.php?mode=viewprofile&u=25589