Skip to content

Instantly share code, notes, and snippets.

@dequis
Created November 3, 2014 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dequis/b0872cfca39d0bee7f26 to your computer and use it in GitHub Desktop.
Save dequis/b0872cfca39d0bee7f26 to your computer and use it in GitHub Desktop.
PlayerInteractEvent test plugin written in MiniPython
# ---
# 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