Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PlayerMoveEvent test plugin written in MiniPython
# ---
# name: Test
# version: 1.0
# author: dx
# ---
import quick
def format_location(l):
return "x=%.3f y=%.3f z=%.3f yaw=%.3f pitch=%.3f" % \
(l.x, l.y, l.z, l.yaw, l.pitch)
@quick.event('player.PlayerMoveEvent')
def move(event):
quick.log("from:", format_location(event.from))
quick.log(" to:", format_location(event.to))
angle_diff = abs(event.from.yaw - event.to.yaw) + \
abs(event.from.pitch - event.to.pitch)
quick.log("diff: %-10.3f angle: %-10.3f" %
(event.to.distanceSquared(event.from), angle_diff))
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.