mojira.dev
MC-70446

Severe Crash Caused by Custom Villager Trading

What I expected to happen was:
I would summon a villager with custom trades.

What actually happened was:
The trades work normally, however the moment you trade with the villager minecraft crashes.

Steps to reproduce:
1. Log into any 1.8 world
2. using the /summon or /entitydata command, get a villager with custom trades
3. trade with the villager
4. Your game will crash after a couple seconds with a complaint about a ticking entity.

Description: Ticking entity
java.lang.ArrayIndexOutOfBoundsException: 1
	at agp.cu(SourceFile:470)
	at agp.E(SourceFile:186)
	at xn.bJ(SourceFile:477)
	at xm.m(SourceFile:1428)
	at xn.m(SourceFile:339)
	at ws.m(SourceFile:126)

Notes:
This error has persisted throughout the 1.8 snapshots and DOES NOT OCCUR
in 1.7

This error occurs in both singleplayer and multiplayer

Only the player who traded is affected in multiplayer

This bug also causes my desktop environment to freeze after the crash occurs because the mouse fails to unlock from the minecraft window. Upon killing the process through the command line my desktop "splinters." I know no other way to describe this. *This is likely just a bug with java that is not something you can fix.

The command used is:

/summon Villager ~ ~1 ~ 

{Attributes:[{Name:generic.followRange,B­ase:1.0},{Name:generic.movementSpeed,Bas­e:0.001}],CustomName:"Ol' Harv",Invulnerable:1,CareerLevel:100,Career:2,PersistenceRequired:1,CustomNameVisible:1,Profession:1, Offers:{Recipes:[

{buy:{id:371,Count:5},sell:{id:373,Count:1,Damage:8259,tag:{HideFlags:63,

CustomPotionEffects:[
				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
				{
					Id:15,
					Amplifier:0,
					Duration:1200,	
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
					    ],
			display:{
				Name:"Strong booze",
				Lore:[
					"Drink your sorrows out,",
					"  take a hearty swig!  "
				]}
			}},maxUses:1,uses:0},

{buy:{id:371,Count:5},sell:{id:373,Count:1,Damage:8259,tag:{HideFlags:63,

CustomPotionEffects:[
				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
				{
					Id:15,
					Amplifier:0,
					Duration:1200,	
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
					    ],
			display:{
				Name:"Strong booze",
				Lore:[
					"Drink your sorrows out,",
					"  take a hearty swig!  "
				]}
			}},maxUses:1,uses:0},

{buy:{id:371,Count:5},sell:{id:373,Count:1,Damage:8259,tag:{HideFlags:63,

CustomPotionEffects:[
				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
				{
					Id:15,
					Amplifier:0,
					Duration:1200,	
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
					    ],
			display:{
				Name:"Strong booze",
				Lore:[
					"Drink your sorrows out,",
					"  take a hearty swig!  "
				]}
			}},maxUses:1,uses:0},

{buy:{id:371,Count:5},sell:{id:373,Count:1,Damage:8259,tag:{HideFlags:63,

CustomPotionEffects:[
				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
				{
					Id:15,
					Amplifier:0,
					Duration:1200,	
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
					    ],
			display:{
				Name:"Strong booze",
				Lore:[
					"Drink your sorrows out,",
					"  take a hearty swig!  "
				]}
			}},maxUses:1,uses:0},

{buy:{id:371,Count:5},sell:{id:373,Count:1,Damage:8259,tag:{HideFlags:63,

CustomPotionEffects:[
				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
				{
					Id:15,
					Amplifier:0,
					Duration:1200,	
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
					    ],
			display:{
				Name:"Strong booze",
				Lore:[
					"Drink your sorrows out,",
					"  take a hearty swig!  "
				]}
			}},maxUses:1,uses:0},

{buy:{id:371,Count:5},sell:{id:373,Count:1,Damage:8259,tag:{HideFlags:63,	

CustomPotionEffects:[
				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
				{
					Id:15,
					Amplifier:0,
					Duration:1200,	
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
					    ],
			display:{
				Name:"Strong booze",
				Lore:[
					"Drink your sorrows out,",
					"  take a hearty swig!  "
				]}
			}},maxUses:1,uses:0},

{buy:{id:371,Count:5},sell:{id:373,Count:1,Damage:8259,tag:{HideFlags:63,

CustomPotionEffects:[
				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
				{
					Id:15,
					Amplifier:0,
					Duration:1200,	
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
					    ],
			display:{
				Name:"Strong booze",
				Lore:[
					"Drink your sorrows out,",
					"  take a hearty swig!  "
				]}
			}},maxUses:1,uses:0},

{buy:{id:371,Count:5},sell:{id:373,Count:1,Damage:8259,tag:{HideFlags:63,

CustomPotionEffects:[
				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
				{
					Id:15,
					Amplifier:0,
					Duration:1200,	
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},				{
					Id:15,
					Amplifier:0,
					Duration:1200,
				},
					    ],
			display:{
				Name:"Strong booze",
				Lore:[
					"Drink your sorrows out,",
					"  take a hearty swig!  "
				]}
			}},maxUses:1,uses:0}																							     ]
													      }
}

Linked issues

Attachments

Comments 5

we need the exact command used

The Issue is not the trading, its the custom potions' since it has multiple of the same effects (id:15,blindness) the game couldn't handle it. So either only use one effect per a potion or change the id in each of the potions.

The issue is not the potions, I've run similar commands where the traded items are basic things such as bread and the like with no special tags and they too cause crashes. In addition, I get the potion normally after reloading the world. The trade works normally, but shortly after I have traded I crash.

The issue is the Profession & Career combo, exactly like in MC-47630. You're using Profession 1, "Librarian" which only has Career 0, "Librarian". Career 2 doesn't exist and so if the game tries to update the trades list, it crashes.

This turned out to be the proper resolution, thank you. The Career tag must match the possible careers for the Profession tag, otherwise there will be a crash

Thomas Hall

(Unassigned)

Unconfirmed

Minecraft 1.8

Retrieved