Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. @EventHandler
  2. public void onPlayerVelocity(PlayerVelocityEvent paramPlayerVelocityEvent)
  3. {
  4. final Player localPlayer = paramPlayerVelocityEvent.getPlayer();
  5. final Location localLocation = localPlayer.getLocation();
  6. Bukkit.getScheduler().runTaskLater(null, new Runnable()
  7. {
  8. public void run()
  9. {
  10. if ((!localPlayer.isOnline()) || (!localPlayer.isValid()) || (localPlayer == null)) {
  11. return;
  12. }
  13. if (localPlayer.getVehicle() != null) {
  14. return;
  15. }
  16. if (localPlayer.getLocation().add(0.0D, 2.0D, 0.0D).getBlock().getType() != Material.AIR) {
  17. return;
  18. }
  19. if (localPlayer.getFoodLevel() == 0) {
  20. return;
  21. }
  22. if (localPlayer.getLocation().distanceSquared(localLocation) == 0.0D)
  23. {
  24. localPlayer.kickPlayer("§6§lOAC §b§l>> §cKicked: \n§rYou were kicked for suspicious movements!");
  25. }
  26. }
  27. }, 3L);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement