I can't find any helpful information on vectors, so I would like info on vectors and how to use them to say, shoot a fireball straight down or to positive x and z.
In games, vectors are mutable objects defining a position or a direction in 3D space. They can be composed of floats / doubles / integers, but the data type must be same in all of the vectors values: X, Y, Z So, if you use a vector(x:1, y:0, z:0) as a direction for the fireball: Code (Java): @EventHandler public void onPlayerCLick(PlayerInteractEvent interactEvent) { Player player = interactEvent.getPlayer(); Vector vector = new Vector(1, 0, 0); Fireball fireball = player.getWorld().spawn(player.getLocation().setDirection(vector), Fireball.class); } It will shoot the fireball to that direction unrelatively to the player; View attachment 709454 If you want to shoot the fireball to direction the player is looking use: Code (Text): @EventHandler public void onPlayerCLick(PlayerInteractEvent interactEvent) { Player player = interactEvent.getPlayer(); Fireball fireball = player.getWorld().spawn(player.getLocation(), Fireball.class); }
Sorry for late response, but this is a great response. Not only does it give you the info on how it works and how to use it, but you also show some real world examples and code. 10/10.