squeek502 / AppleCore

An API for modifying the food and hunger mechanics of Minecraft
The Unlicense
55 stars 24 forks source link

/hunger command treats second argument as both player and value. #146

Closed James103 closed 4 years ago

James103 commented 4 years ago

It appears that when the /hunger command is used with two arguments, the second argument is treated as both the player and the value. This causes the command to break if used with two arguments, effectively preventing it from being used this way. The wiki lists the command syntax to be /hunger [player] <value>, but /hunger <value> works and sets the hunger value for the executor.

This behavior is caused by the following code: https://github.com/squeek502/AppleCore/blob/2dbabf16b09527faae9107d9e8ab5b8150e03d8f/java/squeek/applecore/commands/CommandHunger.java#L43-L45 The fix is as simple as changing the first args[1] on line 43 of the above code to args[0].