[SPIGOT-180] Vanilla XP command does not subtract experience orbs Created: 11/Dec/14  Updated: 11/Dec/14  Resolved: 11/Dec/14

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

Type: Bug Priority: Minor
Reporter: Justin W. Flory (jflory7) Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: 1.8, bug, experience, spigot
Environment:

Java Version: OpenJDK 1.7.0_71
Plugins (18): zPermissions, AutoMessage, VoteRoulette, AsyncWorldEditInjector, WorldEdit, NoCheatPlus, Minetrends, Buycraft, AdminPrivateChat, ClearLag, Votifier, WorldGuard, CommunityBridge, Essentials, AsyncWorldEdit, EssentialsSpawn, VanishNoPacket, EssentialsChat



 Description   

Whenever the vanilla XP command is used to subtract experience orbs, the behavior they exhibit is unprecedented.

As a bit of background, my server uses command blocks to act as XP Shops for the players to buy items using their XP orbs. Originally, we were using the Essentials /exp command, but after discovering that the Essentials implementation had a game-breaking issue of its own (which will be filed separately), we began using /minecraft:xp instead.

One feature we have is an XP Bank which exchanges experience orbs for Bottles 'o' Enchanting, but we have found we cannot subtract experience orbs using the vanilla XP command. Whenever we try subtracting experience orbs using a command such as "/minecraft:xp -50 jflory7", this error is output: "Cannot subtract negative experience."

However, it IS possible to subtract levels (e.g. "/minecraft:xp -50L jflory7") which is what leads me to think this may be a bug.

Any additional information available on request.



 Comments   
Comment by Justin W. Flory (jflory7) [ 11/Dec/14 ]

Closed: Natural vanilla behavior

Comment by Justin W. Flory (jflory7) [ 11/Dec/14 ]

FearThe1337
Oh, of course… well, guess this issue is closed. Guess I just need to cross my fingers for the Essentials /exp command to get fixed now.

Comment by FearThe1337 [ 11/Dec/14 ]

This is the exact same behaviour as vanilla.
Since were trying to replicate vanilla behaviour this should be normal.

Vanilla:
xp 50 FearThe1337
[21:45:07] [Server thread/INFO]: Given 50 experience to FearThe1337
xp -50 FearThe1337
[21:45:14] [Server thread/INFO]: Cannot give player negative experience points
xp 50L FearThe1337
[21:45:19] [Server thread/INFO]: Given 50 levels to FearThe1337
xp -50L FearThe1337
[21:45:23] [Server thread/INFO]: Taken 50 levels from FearThe1337

Spigot:
>xp 50 FearThe1337
[21:46:28 INFO]: Given 50 experience to FearThe1337
>xp -50 FearThe1337
[21:46:31 INFO]: Cannot give player negative experience points
>xp 50L FearThe1337
[21:46:34 INFO]: Given 50 levels to FearThe1337
>xp -50L FearThe1337
[21:46:38 INFO]: Taken 50 levels from FearThe1337

Comment by Justin W. Flory (jflory7) [ 11/Dec/14 ]

Just drastically edited the nature of this bug report. Some things were fixed but other things were not. Adjusted the information in the report to reflect that.

Comment by Justin W. Flory (jflory7) [ 11/Dec/14 ]

Upon further investigation, it seems that the behavior we've been experiencing with the /minecraft:xp command has cleared up for OPs. I did upgrade last night to the listed version in this bug report, so it is likely related.

We are testing for default players as well. If it works successfully, I will close this issue.

Generated at Mon Apr 21 21:19:16 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.