mojira.dev
MC-108729

When giving yourself items with negative durability, the game crashes.

I tried giving myself an item with negative durability with this command:

/give @p minecraft:golden_hoe 1 50

In previous versions, this has given me an item with negative durability. When I tried it in the new snapshot, it just crashed the game. It then corrupted the world, so I could not use it again.

Attachments

Comments 3

Doesn't crash for me.

I can reproduce this, but only with some data values. The crash seems to be related to the new method of colouring the durability bar, looking at the error:

Time: 14/10/16 18:14
Description: Unexpected error

java.lang.RuntimeException: Something went wrong when converting from HSV to RGB. Input was -76.1875, 1.0, 1.0
at os.c(SourceFile:576)
at bvb.a(SourceFile:437)
at bvb.a(SourceFile:402)
at bfc.a(SourceFile:1005)
at bfc.a(SourceFile:463)
at bfc.a(SourceFile:153)
at bpz.a(SourceFile:1061)
at ben.av(SourceFile:990)
at ben.a(SourceFile:395)
at net.minecraft.client.main.Main.main(SourceFile:124)

This corrupts the world. The game crashes with the same error as above when loading the world.

However, results are varied. Sometimes the command simply outputs that it gave the player air, regardless of what item was specified. Sometimes the command works, and gives the player the specified item with an unobtainable data value. And sometimes the command crashes the game and corrupts the world:

• Using /give @p minecraft:golden_hoe 1 40 gave me a golden hoe with -8 durability, as expected (since golden hoes usually have a durability of 32).

• Using /give @p minecraft:golden_hoe 1 50 crashed the game and corrupted the world.

• Using /give @p minecraft:golden_hoe 1 70000 output Given [Air] * 1 to HalfOfAKebab.

I suggest that if you want to stop the corruption if your world got corrupted, go into the previous snapshot and delete any items with negative durability.

BCNOFNeNaMg

Agnes Larsson

Confirmed

color, crash, durability, item

Minecraft 16w41a

Minecraft 16w42a

Retrieved