Hello! I am currently attempting to code a troll plugin. One of the things I am planning to add is unlimited reach, but I do not know how to do so. If anybody can hint me or give me documentation relating to this, that would be great!
https://bukkit.org/threads/changing-melee-range-of-player-particle-mid-ranged-attacks.354611/ Think this does a pretty good job of explaining how you could do this.
or you could make own hit detection instead of using snowball for it, because snowballs aren't very accurate (they can't go through some blocks through which a player can hit)
well, a simple way would be to use "target player" (that is like skript's built-in detection of at what entity you are looking at, but note that target player will ignore entities inbetween, so may be better to use "target entity") and then scan blocks between players to ensure that the player isn't behind blocks, you could also use skript-mirror and then use hasLineOfSight from spigot api, which may remove the need of block scanning for better performance
Using the addon skript-mirror you could use this: The value "128" is the maximum distance you want for this raytrace. This value should not be higher than the render distance (render distance * 16), otherwise the raytrace might load chunks. Code (Text): import: org.bukkit.FluidCollisionMode on left click: set {_l} to event-player.getEyeLocation() set {_v} to vector from yaw {_l}.getYaw() and pitch {_l}.getPitch() set {_raytraceresult} to {_l}.getWorld().rayTrace({_l}, {_v}, 128, FluidCollisionMode.NEVER!, true, 0, null) set {_victim} to {_raytraceresult}.getHitEntity() {_victim} is set: {_victim} = a player # condition to check if victim is a player {_victim}.damage(10, event-player) #applies 10 damage to the hit player with event player as cause Overall this will shoot a raycast from the player's eyes in the exact direction the player is facing