Advertisement
Guest User

SchutzSchild

a guest
Nov 1st, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. @EventHandler
  2. public void onPlayerInteract(PlayerInteractEvent e){
  3. Player p = e.getPlayer();
  4. if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK){
  5. if(e.getItem().getType() == Material.EYE_OF_ENDER){
  6. e.setCancelled(true);
  7. if(p.isSneaking()){
  8. if(!p.hasPermission("dirk.shield")){
  9. p.sendMessage("§4Keine Permissions!");
  10. return;
  11. }
  12. e.setCancelled(true);
  13. p.getWorld().playEffect(p.getLocation(), Effect.ENDER_SIGNAL, 5);
  14. for (Entity ent : p.getNearbyEntities(3.0D, 3.0D, 3.0D)){
  15. if(ent instanceof Player){
  16. if(!((Player) ent).hasPermission("dirk.shield")){
  17. ent.setVelocity(ent.getLocation().getDirection().multiply(-1.7D).setY(0.7D));
  18. }
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement