Skip to content

Instantly share code, notes, and snippets.

@pirogoeth
Created May 31, 2011 22:25
Show Gist options
  • Save pirogoeth/1001415 to your computer and use it in GitHub Desktop.
Save pirogoeth/1001415 to your computer and use it in GitHub Desktop.
Teleport plugin for bravo minecraft server
class Teleport(object):
implements(IChatCommand)
def chat_command(self, username, parameters):
p = parse_player(factory, username)
if len(parameters) == 0:
msg = "not enough parameters..."
return (msg,)
else:
try: to_player = parse_player(factory, parameters[0])
except: return "Player %s is nonexistant!" % (parameters[0])
new_loc = to_player.player.location
p.player.location.x = new_loc.x
p.player.location.y = new_loc.y
p.player.location.z = new_loc.z
msg = "Teleported to %s <%s, %s, %s>" % (new_loc.x, new_loc.y, new_loc.z)
return msg
name = "tp"
aliases = tuple("teleport",)
usage = "/tp <nickname>"
info = "Teleport to another player"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment