[SPIGOT-7209] Getter and Setter for a Player's exp cooldown Created: 15/Dec/22 Updated: 25/Dec/24 Resolved: 21/Apr/23 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor |
| Reporter: | Almighty-Satan | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Player, Spigot, Xp | ||
| Version: | This server is running CraftBukkit version 3625-Spigot-d90018e-585ab5b (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT) |
| Guidelines Read: | Yes |
| Description |
|
net/minecraft/world/entity/player/EntityHuman has an exp-cooldown field (in 1.19.3 it's called bZ). Setting this field to a very high value (Integer.MAX_VALUE) allows a plugin to prevent a player from being able to pick up experience orbs and also prevents the animation of the orbs moving towards the player. Currently this has to be done via reflections as there is no getter/setter for this field. Therefore I'd suggest adding methods like Player#getExpCooldown & Player#setExpCooldown that return/set the value of the exp-cooldown field. |
| Comments |
| Comment by Almighty-Satan [ 16/Dec/22 ] |
|
An event definitely sounds like an interesting idea, tho simple getter/setter methods would be enough for my use case. Also I do not have permission to view that PR. |
| Comment by FreeSoccerHDX [ 15/Dec/22 ] |
|
What about this one .... Pull Request |
| Comment by FreeSoccerHDX [ 15/Dec/22 ] |
|
Sounds interesting.... probably an idea to have a Event when setting the cooldown too ? |