S
Scrumplex
Guest
Hi Community,
bin neu hier und wollte mmal fragen warum das was im Titel erwähnt wurde nicht geht?
Bitte hilft mir!
bin neu hier und wollte mmal fragen warum das was im Titel erwähnt wurde nicht geht?
Code:
@EventHandler(priority=EventPriority.HIGH)
public void onPlayerUse(PlayerInteractEvent event){
Player p = event.getPlayer();
if(event.getAction().equals(Action.LEFT_CLICK_AIR)){
if(p.getItemInHand().getType() == Material.BLAZE_ROD){
event.setCancelled(true);
double Height = 5 / 15D;
double Lenght = 16 / 8D;
Player pe = event.getPlayer();
pe.setVelocity(pe.getLocation().getDirection().setY(Height).multiply(Lenght));
pe.playSound(pe.getLocation(), Sound.WITHER_SHOOT, 1F, 1F);
}
}
if(event.getAction().equals(Action.RIGHT_CLICK_AIR)){
if(p.getItemInHand().getType() == Material.BLAZE_ROD){
event.setCancelled(true);
double Height = 5 / 15D;
double Lenght = 16 / 8D;
Player pe = event.getPlayer();
pe.setVelocity(pe.getLocation().getDirection().setY(Height).multiply(Lenght));
pe.playSound(pe.getLocation(), Sound.WITHER_SHOOT, 1F, 1F);
}
}
}
Bitte hilft mir!