Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onPlayerInteract(PlayerInteractEvent e){
- Player p = e.getPlayer();
- if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK){
- if(e.getItem().getType() == Material.EYE_OF_ENDER){
- e.setCancelled(true);
- if(p.isSneaking()){
- if(!p.hasPermission("dirk.shield")){
- p.sendMessage("ยง4Keine Permissions!");
- return;
- }
- e.setCancelled(true);
- p.getWorld().playEffect(p.getLocation(), Effect.ENDER_SIGNAL, 5);
- for (Entity ent : p.getNearbyEntities(3.0D, 3.0D, 3.0D)){
- if(ent instanceof Player){
- if(!((Player) ent).hasPermission("dirk.shield")){
- ent.setVelocity(ent.getLocation().getDirection().multiply(-1.7D).setY(0.7D));
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement