summaryrefslogtreecommitdiff
path: root/skullclick.py
diff options
context:
space:
mode:
authorjomo <github@jomo.tv>2014-05-16 23:04:40 +0200
committerjomo <github@jomo.tv>2014-05-16 23:04:40 +0200
commit9f1ed1fb668f0a60170eac88909bf2b3e69402f8 (patch)
tree4a82a8a58a1f623ef29af4bc0fdb2c780d4f773c /skullclick.py
first commit via git
Diffstat (limited to 'skullclick.py')
-rw-r--r--skullclick.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/skullclick.py b/skullclick.py
new file mode 100644
index 0000000..448dfaf
--- /dev/null
+++ b/skullclick.py
@@ -0,0 +1,15 @@
+import org.bukkit as bukkit
+from helpers import *
+
+@hook.event("player.PlayerInteractEvent", "monitor")
+def onInteract(event):
+ if (str(event.getAction()) == "RIGHT_CLICK_BLOCK"):
+ sender = event.getPlayer()
+ block = event.getClickedBlock().getState()
+ if (isinstance(block, bukkit.block.Skull) and not event.isCancelled()):
+ owner = block.getOwner()
+ if (owner):
+ msg(sender, "&eThat's %s." % owner)
+ else:
+ msg(sender, "&cThis skull has no name (Steve)")
+ event.setCancelled(True)