Hello all, I want to right click on bow for launch a firework on the player direction. Code:java Location l = p.getLocation() // location Firework fw = (Firework) l.getWorld().spawn(l, Firework.class); but this code don't launch a firework on the player direction but it launch a firework on the player. Good evening all.
Fireworks go up by default, you're doing nothing to prevent this, and you're doing nothing to actually move the firework. The best way to accomplish this would probably be to use NMS and override EntityFireworks' move(); method.
Pretty sure you can only accomplish this by using NMS or using ugly, inefficient scheduler teleportation or something like that. You could also try setting the firework's velocity, but it'd still go up.