Open rom1504 opened 8 years ago
So we mostly agreed on a pattern here with @demipixel . Have a "useItem", a "useBlock" and a "placeBlock" each emitted in the "block_place" packet listener. They should be emitted depending on some conditions (shift-clicking, what you are holding, what is where you are clicking)
These events/behaviors can be used for example in chest.js , for notes, and for all the various cases of item uses (see also #9 and "placing items" like bed/doors/...)
It seems like "useBlock" will only really work on furnaces, crafting benches, chests, enchantment tables, etc (anything that opens a window, except for villagers, that's a useEntity)
EDIT: Also redstone stuff like pressing a button or pulling a lever
buckets, ... This should be plugged in block_place : check whether the player is using an item ( if(items[heldItem.id] ) and do stuff depending on the item.