Cuberite Forum

Full Version: onActionCallBack
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Are there any callback that works when player do something with some blockEntity (right click)? For example, when player open the chest or close the door. I want to write plugin, providing private chest , but I can not find any callback on this situation.

P.S. Is wiki plugin API documentation up to date?
(03-31-2012, 08:57 AM)geser Wrote: [ -> ]Are there any callback that works when player do something with some blockEntity (right click)? For example, when player open the chest or close the door. I want to write plugin, providing private chest , but I can not find any callback on this situation.
Use E_PLUGIN_BLOCK_PLACE
http://mc-server.org/wiki/doku.php?id=ap...blockplace

(03-31-2012, 08:57 AM)geser Wrote: [ -> ]P.S. Is wiki plugin API documentation up to date?
No, it's not
Thanks. Callback name is not good i think. May be onBlockRightClick, or other name will be better?
(04-01-2012, 04:37 AM)geser Wrote: [ -> ]Thanks. Callback name is not good i think. May be onBlockRightClick, or other name will be better?

YupTongue
Tiny bump:
I want a hook for right-click with an empy hand (or a tool/weapon) on any "static" block (not a chest or something "actable")

Should I use E_PLUGIN_BLOCK_PLACE? If so - how do I "get" what kind of item player was holding while right-click?
There's player link in E_PLUGIN_BLOCK_PLACE, and player has an inventory, but I don't know how to get infro about which item was held by player. Is it possible? (Yes, I'm a maniac and I would like to write a runecraft analog)
Yes, use E_PLUGIN_BLOCK_PLACE.

And yes you can get the currently holding item from the player's inventory.

http://mc-server.org/wiki/doku.php?id=api:cinventory
cPlayer:GetInventory():GetEquippedItem()

This gives you a cItem object http://mc-server.org/wiki/doku.php?id=api:citem
Oh, I appologize for being inattentive again Smile Thanks
No problem, I'm glad you askTongue