Skip to content

Instantly share code, notes, and snippets.

@d3xtro
Created April 18, 2011 19:42
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 d3xtro/926019 to your computer and use it in GitHub Desktop.
Save d3xtro/926019 to your computer and use it in GitHub Desktop.
@Override
public final void onPlayerInteract(PlayerInteractEvent event) {
//simulate lag
try { Thread.sleep(500); } catch (Exception e) {}
final Location loc = event.getPlayer().getLocation();
switch (event.getAction()) {
case RIGHT_CLICK_AIR:
plugin.log("PlayerListener.onPlayerInteract(" + event.getAction() + ", " + event.isBlockInHand() + ", " + event.hasBlock() + ")");
/*
if (placedBlockOnAir) {
event.getPlayer().sendMessage("If you lag jump you may look like a flyer and be banned.");
loc.setY(loc.getWorld().getHighestBlockYAt(loc));
event.getPlayer().teleport(loc);
}
*/
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment