Created
November 3, 2014 07:09
-
-
Save dequis/b0872cfca39d0bee7f26 to your computer and use it in GitHub Desktop.
PlayerInteractEvent test plugin written in MiniPython
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --- | |
# name: PlayerInteractEventTest | |
# --- | |
import quick | |
def msg(text): | |
quick.plugin.server.broadcastMessage(text) | |
def nice(text): | |
return str(text).replace("_", " ").capitalize() | |
@quick.event('player.PlayerInteractEvent') | |
def derp(event): | |
msg("[%s] %s [%s] -> %s" % ( | |
nice(event.item.type) if event.item else None, | |
nice(event.action), | |
nice(event.clickedBlock.type) if event.clickedBlock else None, | |
nice(event.useInteractedBlock()) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment