[SPIGOT-7550] launchProjectile(Arrow.class) not instance of Arrow Created: 19/Dec/23 Updated: 25/Dec/24 Resolved: 20/Dec/23 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Ssomar | Assignee: | Doc |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Version: | This server is running CraftBukkit version 3976-Spigot-06d602e-b3b43a6 (MC: 1.20.4) |
| Guidelines Read: | Yes |
| Description |
|
Hello, If you launch an arrow with the method launchProjectile(), the entity return by this method is not instance of Arrow.
Example with a simple event @EventHandler() public void onPlayerToggleSneakEvent(PlayerToggleSneakEvent e) { Bukkit.broadcastMessage("PlayerToggleSneakEvent"); if (e.isSneaking()) { Entity entity = e.getPlayer().launchProjectile(Arrow.class); Bukkit.broadcastMessage("Projectile instance of Arrow ? "+(entity instanceof Arrow)); } else Bukkit.broadcastMessage("Not Sneaking"); } Output of this event :
|
| Comments |
| Comment by Ssomar [ 20/Dec/23 ] |
|
Thank you very much |
| Comment by Doc [ 20/Dec/23 ] |
|
I check internally and i create a PR for fix this. https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1319/overview |
| Comment by Ssomar [ 20/Dec/23 ] |
|
I don't understand your comment Doc, you mean that Can you share the ouputs sent by Test.jar plugin ? |
| Comment by Doc [ 20/Dec/23 ] |
|
Currently tested the Class result of that is AbstractArrow and not Arrow, tested in plugin and that return true.. |
| Comment by Ssomar [ 20/Dec/23 ] |
|
|
| Comment by Black Hole [ 20/Dec/23 ] |
|
Could you add entity.toString() to the output? |