[SPIGOT-8008] Force value in spawnParticle Method not working Created: 10/Feb/25 Updated: 10/Feb/25 Resolved: 10/Feb/25 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Alphaton | Assignee: | Doc |
Resolution: | Fixed | Votes: | 0 |
Labels: | 1.21.4, Particle, Spigot |
Attachments: |
![]() ![]() |
Version: | CraftBukkit version 4435-Spigot-d421948-c175d4f (MC: 1.21.4) (Implementing API version 1.21.4-R0.1-SNAPSHOT) |
Guidelines Read: | Yes |
Description |
Particles spawned with the World.spawnParticle method are created with force set to false regardless of the value of the parameter of the method. This means, that all particles created using the spigot API are not visible to players when they are >= 32 blocks away from the particle.
Example to reproduce: The following continuously spawns a particle at the location of arrows fired by the player:
new BukkitRunnable() { @Override public void run() { for (Entity entity : Bukkit.getWorlds().get(0).getEntities()) { if (!(entity instanceof AbstractArrow arrow)) continue; if (!(arrow.getShooter() instanceof Player)) continue; if (arrow.isInBlock()) continue; entity.getWorld().spawnParticle(Particle.EXPLOSION, entity.getLocation(), 1, 0, 0, 0, 0, null, true); } } }.runTaskTimer(this, 0, 1); Expected Behavior: Actual Behavior: Additional Evidence: The attached Jar is a simple reproduction plugin. Simply shoot an arrow using a bow. The particles should stop spawning after around 32 blocks. If ProtocolLib is also installed, some debug information about the particle creation will be printed in the in-game chat. |
Comments |
Comment by Doc [ 10/Feb/25 ] |
PR created for fix that: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1535/overview |