onActionCallBack
#1
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?
Reply
Thanks given by:
#2
(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
Reply
Thanks given by:
#3
Thanks. Callback name is not good i think. May be onBlockRightClick, or other name will be better?
Reply
Thanks given by:
#4
(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
Reply
Thanks given by:
#5
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)
Reply
Thanks given by:
#6
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
Reply
Thanks given by: Taugeshtu
#7
Oh, I appologize for being inattentive again Smile Thanks
Reply
Thanks given by:
#8
No problem, I'm glad you askTongue
Reply
Thanks given by:




Users browsing this thread: 6 Guest(s)