Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.