mojira.dev
MC-30484

Giving items with unknown (high) data value crashes and leaves the world unusable

Giving items with unknown (high) data value crashes and leaves the world unusable:

  • /give @p minecraft:double_flower 1 15

  • /give ID minecraft:planks 1 12

  • /give @p minecraft:double_plant 1 12

  • /give @p minecraft:sand 1 3


  • This has completely corrupted my Snapshot testing world to an unusable state, so it is very lethal.

    ---- Minecraft Crash Report ----
    // I let you down. Sorry :(
    
    Time: 9/8/13 12:55 PM
    Description: Rendering entity in world
    
    java.lang.ArrayIndexOutOfBoundsException: 6
    	at apx.a(SourceFile:149)
    	at yb.b_(SourceFile:19)
    	at yv.j(SourceFile:357)
    	at yx.c(SourceFile:94)
    	at bja.a(SourceFile:127)
    	at bja.a(SourceFile:29)
    	at bip.a(SourceFile:206)
    	at bip.a(SourceFile:186)
    	at bho.a(SourceFile:327)
    	at bhh.a(SourceFile:848)
    	at bhh.b(SourceFile:695)
    	at avx.V(SourceFile:713)
    	at avx.e(SourceFile:642)
    	at net.minecraft.client.main.Main.main(SourceFile:103)
    
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- Head --
    Stacktrace:
    	at apx.a(SourceFile:149)
    	at yb.b_(SourceFile:19)
    	at yv.j(SourceFile:357)
    	at yx.c(SourceFile:94)
    	at bja.a(SourceFile:127)
    	at bja.a(SourceFile:29)
    
    -- Entity being rendered --
    Details:
    	Entity Type: Item (tj)
    	Entity ID: 57677
    	Entity Name: item.tile.doublePlant.sunflower
    	Entity's Exact location: -2529.38, 74.31, 38.09
    	Entity's Block location: World: (-2530,74,38), Chunk: (at 14,4,6 in -159,2; contains blocks -2544,0,32 to -2529,255,47), Region: (-5,0; contains chunks -160,0 to -129,31, blocks -2560,0,0 to -2049,255,511)
    	Entity's Momentum: 0.28, -0.00, 0.07
    
    -- Renderer details --
    Details:
    	Assigned renderer: bja@b9bb107
    	Location: -0.00,-0.31,-0.02 - World: (-1,-1,-1), Chunk: (at 15,-1,15 in -1,-1; contains blocks -16,0,-16 to -1,255,-1), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
    	Rotation: 0.7690946
    	Delta: 0.039065123
    Stacktrace:
    	at bip.a(SourceFile:206)
    	at bip.a(SourceFile:186)
    	at bho.a(SourceFile:327)
    	at bhh.a(SourceFile:848)
    
    -- Affected level --
    Details:
    	Level name: MpServer
    	All players: 1 total; [bfg['goldkilla88'/172, l='MpServer', x=-2529.37, y=74.62, z=38.11]]
    	Chunk stats: MultiplayerChunkCache: 272, 272
    	Level seed: 0
    	Level generator: ID 00 - default, ver 1. Features enabled: false
    	Level generator options: 
    	Level spawn location: World: (-252,64,248), Chunk: (at 4,4,8 in -16,15; contains blocks -256,0,240 to -241,255,255), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
    	Level time: 53284 game time, 5026 day time
    	Level dimension: 0
    	Level storage version: 0x00000 - Unknown?
    	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
    	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
    	Forced entities: 56 total; [sd['Bat'/9211, l='MpServer', x=-2508.31, y=56.10, z=27.50], so['Sheep'/279, l='MpServer', x=-2505.88, y=63.00, z=-32.09], sn['Pig'/283, l='MpServer', x=-2511.47, y=63.00, z=-24.16], sn['Pig'/282, l='MpServer', x=-2501.94, y=64.00, z=-31.06], so['Sheep'/281, l='MpServer', x=-2509.19, y=63.00, z=-38.13], so['Sheep'/286, l='MpServer', x=-2502.16, y=68.00, z=0.06], sn['Pig'/285, l='MpServer', x=-2509.53, y=64.00, z=-26.03], sn['Pig'/284, l='MpServer', x=-2505.50, y=65.00, z=-20.22], sd['Bat'/56827, l='MpServer', x=-2520.57, y=42.02, z=47.29], sd['Bat'/56828, l='MpServer', x=-2541.73, y=32.03, z=46.46], so['Sheep'/266, l='MpServer', x=-2527.50, y=68.00, z=-17.22], so['Sheep'/267, l='MpServer', x=-2517.56, y=64.00, z=-12.31], tj['item.item.egg'/57180, l='MpServer', x=-2559.28, y=68.13, z=75.44], sd['Bat'/56818, l='MpServer', x=-2527.52, y=23.16, z=-1.95], so['Sheep'/265, l='MpServer', x=-2520.19, y=63.00, z=-27.91], sf['Chicken'/305, l='MpServer', x=-2464.34, y=68.00, z=84.47], sf['Chicken'/304, l='MpServer', x=-2469.84, y=68.58, z=75.53], sn['Pig'/307, l='MpServer', x=-2458.50, y=76.00, z=20.50], sn['Pig'/306, l='MpServer', x=-2468.03, y=64.00, z=25.97], sf['Chicken'/309, l='MpServer', x=-2458.50, y=73.00, z=77.50], sf['Chicken'/308, l='MpServer', x=-2461.50, y=71.00, z=78.50], bfg['goldkilla88'/172, l='MpServer', x=-2529.37, y=74.62, z=38.11], sf['Chicken'/310, l='MpServer', x=-2448.47, y=73.00, z=83.44], sd['Bat'/54738, l='MpServer', x=-2608.75, y=32.72, z=88.50], sr['Squid'/51517, l='MpServer', x=-2523.04, y=61.31, z=55.51], sr['Squid'/51516, l='MpServer', x=-2524.53, y=61.32, z=56.81], sd['Bat'/55278, l='MpServer', x=-2523.51, y=25.00, z=-31.06], so['Sheep'/290, l='MpServer', x=-2495.53, y=68.00, z=-38.81], sr['Squid'/51518, l='MpServer', x=-2518.64, y=61.34, z=58.46], sd['Bat'/1984, l='MpServer', x=-2509.25, y=55.10, z=26.25], so['Sheep'/292, l='MpServer', x=-2494.47, y=68.00, z=-37.78], so['Sheep'/293, l='MpServer', x=-2495.09, y=68.00, z=-35.94], sn['Pig'/299, l='MpServer', x=-2465.50, y=66.00, z=23.50], sn['Pig'/300, l='MpServer', x=-2468.50, y=70.00, z=22.69], sd['Bat'/54715, l='MpServer', x=-2520.25, y=28.36, z=-5.75], sd['Bat'/53955, l='MpServer', x=-2560.50, y=18.10, z=27.25], sd['Bat'/29192, l='MpServer', x=-2527.44, y=45.10, z=34.72], sd['Bat'/56833, l='MpServer', x=-2475.21, y=56.89, z=-1.77], sf['Chicken'/220, l='MpServer', x=-2605.53, y=64.00, z=97.41], sd['Bat'/56832, l='MpServer', x=-2493.38, y=58.10, z=2.25], sd['Bat'/16598, l='MpServer', x=-2513.34, y=54.10, z=26.94], sn['Pig'/239, l='MpServer', x=-2588.97, y=70.00, z=43.03], sf['Chicken'/236, l='MpServer', x=-2606.69, y=64.00, z=96.69], sf['Chicken'/235, l='MpServer', x=-2607.50, y=64.00, z=89.50], sf['Chicken'/234, l='MpServer', x=-2603.50, y=62.37, z=90.50], sn['Pig'/233, l='MpServer', x=-2597.66, y=72.00, z=51.25], sd['Bat'/28486, l='MpServer', x=-2510.25, y=54.10, z=25.25], sn['Pig'/250, l='MpServer', x=-2544.03, y=74.00, z=94.16], sn['Pig'/248, l='MpServer', x=-2551.50, y=75.00, z=92.50], sn['Pig'/249, l='MpServer', x=-2551.09, y=75.00, z=86.47], sf['Chicken'/246, l='MpServer', x=-2554.50, y=71.00, z=78.50], sn['Pig'/247, l='MpServer', x=-2548.88, y=80.00, z=100.09], sf['Chicken'/245, l='MpServer', x=-2552.50, y=68.00, z=79.50], sf['Chicken'/242, l='MpServer', x=-2560.56, y=71.00, z=76.59], sf['Chicken'/243, l='MpServer', x=-2560.47, y=68.00, z=75.53], tj['item.item.egg'/51436, l='MpServer', x=-2551.56, y=68.13, z=78.63]]
    	Retry entities: 0 total; []
    	Server brand: vanilla
    	Server type: Integrated singleplayer server
    Stacktrace:
    	at bfb.a(SourceFile:285)
    	at avx.b(SourceFile:1813)
    	at avx.e(SourceFile:651)
    	at net.minecraft.client.main.Main.main(SourceFile:103)

Linked issues

MC-29658 Hopper: java.lang.ArrayIndexOutOfBoundsException: 6 MC-29862 Hopper: java.lang.ArrayIndexOutOfBoundsException: 6 MC-29988 Hopper: java.lang.ArrayIndexOutOfBoundsException: 9 MC-30025 Hopper: java.lang.ArrayIndexOutOfBoundsException: 9 MC-30196 Hopper: java.lang.ArrayIndexOutOfBoundsException: 9 MC-30331 Hopper: java.lang.ArrayIndexOutOfBoundsException: 9 MC-30352 Hopper: java.lang.ArrayIndexOutOfBoundsException: 7 MC-30899 The forbidden item = Item number 175 with data value of 6. MC-31016 /setblock command crashes minecraft MC-31151 Item Crash MC-31469 Hopper: java.lang.ArrayIndexOutOfBoundsException: 6 MC-31476 Hopper: java.lang.ArrayIndexOutOfBoundsException: 6 MC-34521 Giving a tall plant block with invalid data value crashes MC-37700 Hopper: java.lang.ArrayIndexOutOfBoundsException: 6 MC-38140 Hopper: java.lang.ArrayIndexOutOfBoundsException: 6 MC-38148 Hopper: java.lang.ArrayIndexOutOfBoundsException: 6 MC-40213 Top of two-block-high flowers without a bottom crashes Minecraft MC-40622 double_plant 6 crashes the game; not able to load the map MC-40843 A invisible block that crashes the game MC-42539 using give to get double tall flowers with damage value above 5 breaks map MC-45872 Crash when placing sunflower that was floating in the air MC-46891 Rendering Item MC-50716 I used a /give command, and now I crash when I try to enter my world. MC-50911 Command /give can crash the map MC-50985 High item ids crashes the game MC-51033 /give crash MC-51256 Giving Sand x1 dv.2 crashes game MC-51284 Game crashes with /give command MC-51450 Crash -- Tall Flowers with the data of 6 MC-51673 Testing block IDs and 'damage' numbers MC-52933 175:6 Block Crashes Clients MC-53790 crash on giving sapling type 6 MC-53868 Failed to render the sand block item with datavalue 7 MC-53925 Giving sand with a value of 5 crashes game. MC-54307 OutOfBoundsException - Custom Meta MC-54439 Invalid Flower Datavalue Crash MC-55148 Giving your self invaild ID crashes the games and courpets your world MC-55329 Doing "/give @p sand 1 2" gives a crash MC-55462 Mining sand with invalid data values crashes game MC-55559 Sand Array Error MC-55578 I can´t load my minecraft world. MC-55717 minecraft crashes after destroying a black-purple block MC-56235 I used /give @p minecraft:double_plant 1 6 and it crashed my game MC-56418 My world crashed MC-59807 Crash report: Game ended with bad state (exit code -1) MC-59815 Game shuts down every time pressing 'e' to open inventory MC-61692 Hopper: java.lang.ArrayIndexOutOfBoundsException: 69 MC-62624 Crashed because I console command spawned an invalid block in realm MC-64288 Every time I log on to the Lichcraft creative server I crash MC-67658 Realm crash when i connect. Please Help!

Comments

Anon Ymus

That block doesn't exist and the game doesn't know what it is.

Ruben van Baarle

That block is added in the latest snapshot, even if it didn't exist, the give command should prevent it from crashing the game.

Anon Ymus

175 has some flowers, but it only goes up to a damage value of 5. Don't play with stuff that isn't supposed to be used. If you want to use custom items, be aware of the consequences.

James

Is it possible that values above 5 are the other halves of those flowers? Like the ones that spawn as 2 blocks tall, alike a piston each block section is a different value.

Justin

Thats what I was trying to find, James. Ymus, if it was non-existent, it would tell me so "This/that id does not exist!"(or something along those lines) and not crash.

Void_Concept

I will tell you if you get above 8 (and it seems mostly any numbers above 8 up to at least 11) will spawn in the upper half of the flower, taking the form of whatever flower is under it. From what I can see, 6 and 7 crash it (and in my case, rendered one of my worlds unloadable). But yea, if there is a command that can be put it, it shouldn't cause an outright crash but instead an error message in the chat.

WolfieMario

This is... quite exploitable, to say the least.

I fail to see how world corruption is the "intended" consequence of using a command. A player may have made a typo (for example, 135:6 wouldn't cause any issues). Besides, obtaining the item via /give will also cause crashes and world corruption. When players reported that wool blocks with damage values above 15 caused crashes, Mojang actually addressed it, and fixed the bug. I don't see why this situation would be intended, if that one wasn't.

WolfieMario

Actually, just to clarify here, as this ticket neglects to mention something important:

This bug can be performed in the vanilla client, with no external tools, via commands such as "/setblock ~ ~ ~ 175 6" and "/give @p 175 1 6". That's what I mean by "exploitable" - although it's a given that a player with OP commands should be able to mess up a world pretty badly, creating a redstone contraption which corrupts the server is just a bit much.

I think Mod Anon Ymus wasn't aware that this bug can be performed in-game using simple commands. Is that correct?

Anon Ymus

No, I was aware, but I feel that messing with blocks that aren't obtainable without purposely /give-ing them to yourself should not be expected to work. Either way, I'll reopen this issue. Mojang can decide what they want done about it.

mees 01234

Yeah, this is annoying, but indeed data value 6 and 7 crash the game, 8 and up spawn the upper halves of the flowers. Hope this helped

Depotato

This is a solution for those needing to fix their Minecraft world when 175:6 is crashing the world
-Download MCEdit
-Run MCEdit for the world
-Create a custom chest (must be a premade chest)
-Add item id 175 and damage value 6
-Click: Remove id from entire world
-tick the box that only deletes the item/block with the damage value
It should fix the problem, if game crashes again, then simply reload the world again.

Tokes

Just had this happen to me. Very annoying to revert to a backup (only 1 day old thank god). Note that the object is in the players inventory and changing it doesn't help (the game still tries to load it as the old value, presumably only honoring the change in the second game tick), although I have a different editor than suggested. Surprised griefers aren't nuking worlds with this (although I guess you'd need permission to use give commands first).

WolfieMario

If it's a singleplayer world, you should be editing the level.dat's copy of the player, not your named file in the players folder (changes are ignored to that in singleplayer). If you did /setblock, you'll need to use MCedit to get rid of it.

Tokes

Yeah I did and it didn't help. No I didn't use setblock, it was "give". I can see the item in slot 4 and change it's damage number and item id but the game still tries to render the old value. I didn't lose very much at all so I'm just cutting my losses. I'm more worried about the fact that they have no intention of fixing it. This could make for some pretty high level griefing on multiplayer, granted they couldn't corrupt the map without access to the give command. Some servers have more levels of permissions than just "full op or nothing" though.

Christie N

Perhaps the bug is not the value crashing the game, but it is Minecraft not recognizing that the metadata values of 6 and 7 are invalid.

Tokes

Normally Mojang puts dupes in the slots (like with Log2 (block 162)). If they'd just made 6 and 7 dupes of 0 and 1 it wouldn't be a problem.

Ratty

This is really becoming a big problem on my server where I let users use the /item command.

Anon Ymus

That command doesn't exist in Minecraft, so it cannot be fixed.

Code Red

I have found a fix for this. This fix works for singleplayer and multiplayer and so far has been compatible with other things like Optifine or a minimap mod.

Decompile Minecraft then go to net.minecraft.block.BlockDoublePlant.java. Open with Notepad++ or your other favorite code editing software. Replace lines 123-131 with this:

public IIcon getIcon(int p_149691_1_, int p_149691_2_)
{
int meta=p_149691_2_ & 7;//XP4L
return func_149887_c(p_149691_2_) || meta>=field_149893_M.length ? this.field_149893_M[0] : this.field_149893_M[meta];//XP4L
}

public IIcon func_149888_a(boolean p_149888_1_, int p_149888_2_)
{
return p_149888_1_ ? (p_149888_2_<field_149894_N.length?this.field_149894_N[p_149888_2_]:this.field_149894_N[0]) : (p_149888_2_<field_149893_M.length?this.field_149893_M[p_149888_2_]:this.field_149893_M[0]);//XP4L
}

Recompile and reobfuscate Minecraft and you should get an aja.class file. Copy a clean version of the version you're running and the .json file that goes with and put it in a new folder under versions. I copied my 1.7.2 version into a folder called 1.7.2_Fix. Rename the .jar you copied to the same name you named the folder. Rename the .json file the same thing as well. Open the .json file with Notepad++ or other code editing software and replace whatever is after "id": with the name you used to rename the folder and files. So for me it would look like a 1.7.2_Fix folder inside versions, and inside that I have 2 files named 1.7.2_Fix.jar and 1.7.2_Fix.json, and inside the .json file I changed "1.7.2" to "1.7.2_Fix." Now open the .jar with WinRAR or 7Zip and drop the aja.class file into the .jar and delete META-INF (like installing a mod). Open the launcher then make a new profile using that new version of minecraft you just made. To test and see if it worked, load a singleplayer world and spawn in the buggy flower with your favorite command (ex. /give Codered999 175 1 6). It should no longer crash you if you hold or place the flower.

I found in multiplayer servers it's a huge issue. Griefers can crash players and force them to not be able to join the server unless their player data was erased. If a player observes another player holding the bugged flower WITHOUT the fix, they see a lot of weird changing entities in the other player's hand and sometimes their name too, and then they crash if that flower is placed. Before I fixed it, I saw things like my friend holding a creeper or a squid or a villager with his name above it tiny. In the pictures below you can see that viewing another player holding the flower without the fix causes entities in the background to glitch around. Now with the fix, anyone views the item and placed block as a sunflower stalk without the sunflower head.

Code Red

Here are some pictures of the bugged flower with and without the fix for anyone interested.

View from another player WITHOUT the fix: http://i.imgur.com/gfP9ozI.png

Another view from another player WITHOUT the fix: http://i.imgur.com/2xKAojw.png

1st person view of item WITH fix: http://i.imgur.com/27Xuuu7.png

3rd person view of item WITH fix: http://i.imgur.com/oXo7NSb.png

1st person view of placed flower WITH fix: http://i.imgur.com/HmRCC2K.png

and another 1st person view of placed flower WITH fix: http://i.imgur.com/HikHQCy.png

Itouch2

Still in 08a and 10c

Tokes

Wait this bug is still around? I thought adding the purple and black checkered block as the default for all missing textures fixed this?

EDIT: Add 1.78 to the list of versions this bug crashes. The actual relevant line in the code is "java.lang.ArrayIndexOutOfBoundsException: 6". 6 was the data value I used for block 175. There's only plants for 0-5 and 8-13 (the top halves of the plants in 0-5). Yes of course I was smart enough to do this to a brand new world. I was expecting it to die.

Code Red

Add snapshot 14w18a

kasamikona

Aidan wick, just a quick question, what is that pig thing in the images you posted?

LOTqwerty

Confirmed for 14w21b

/give @p minecraft:double_plant 1 12
/give @p minecraft:sand 1 3
still cause client crash and make you unable to get into the world.

Eric Martin

It would be really nice if this were fixed in 1.8 then Id be able to re open my world. ( I spent a nice amount of time on it and Id like to be able to continue)

Justin

Fixed in 14w25b, Both item ids 7 and 6 gives you a missing texture block and creates a normal sunflower on placement.

shufboyardee

Still remains, in one place: end portal blocks with eyes.

Code Red

Conor McS, that was a pig behind me. The block made entities act weird when you move around so thats why everything looks warped. Glad to see it fixed for the upcoming 1.8

kumasasa

@@unknown
Cannot confirm.

/give @p end_portal_frame 1 4

does not crash

marcono1234

Could relate to: MC-57332

Justin

(Unassigned)

Confirmed

corrupted, entity, exception, item, item-ids, lethal, rendering, rosebush, singeplayer, spawned, sunflower

Minecraft 13w36a, Minecraft 13w37a, Minecraft 13w37b, Minecraft 13w39b, Minecraft 1.7.2, ..., Minecraft 1.7.8, Minecraft 1.7.9, Minecraft 14w18a, Minecraft 14w20b, Minecraft 14w21b

Minecraft 14w25b

Retrieved