[SPIGOT-6779] Player#attack does not function Created: 01/Nov/21  Updated: 02/Nov/21  Resolved: 02/Nov/21

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: JishunaMatata Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: entity

Version: 3271-Spigot-3892929-cef1fda
Guidelines Read: Yes

 Description   

The attack() method does not work when used on a player instance.

I believe this is due to the fact that EntityHuman#attack is a separate method from EntityLiving#attackEntity



 Comments   
Comment by Doc [ 02/Nov/21 ]

i see in NMS Player use attack and not attackEntity..

 

and in Player the method attack is used for spectate entity if the player is in spectator if not then use the EntityHuman#attack

i make a PR based in this for check in method if the entity where is called in Human. https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/950/overview

Generated at Fri Apr 11 15:30:10 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.