mojira.dev
MC-122075

Cannot subtract xp with negative numbers using /xp

Just user error. No bug.

-The next xp command does not support negitive numbers: /xp set player -10 points

Neither levels nor points work with negatives.

Chat error:
Integer must not be less than 0, found -10 at position 22: ...esAndSuch <==[HERE]

The 1.13 change log does say this is possible:

  • Negative numbers are supported, to subtract points instead.

  • Subtracting points can cause players to level down.

I attempted it with plenty of xp to subtract.-

Comments 1

You're running /xp set – that would set their total exp to -10, which doesn't sound like what you want. Try /xp add player -10 points instead. (Note that the section about negative numbers being allowed is under /xp add – not /xp set)

Zachary C.

(Unassigned)

Unconfirmed

Minecraft 17w46a

Retrieved