mojira.dev
MC-139732

Villager trade menu not opening outside of a village

The bug

Right-clicking on a villager outside of a village doesn't open the trade menu.

Game output

Error executing task
java.lang.NullPointerException
	at aqb.a(SourceFile:285)
	at agp.b(SourceFile:978)
	at aqg.a(SourceFile:1091)
	at ux.a(SourceFile:1191)
	at nn.a(SourceFile:69)
	at nn.a(SourceFile:13)
	at jq.a(SourceFile:15)
	at jq$$Lambda$2262/1552350401.run(Unknown Source)
	at qp.run(SourceFile:18)
	at net.minecraft.server.MinecraftServer.q(SourceFile:646)
	at net.minecraft.server.MinecraftServer.p(SourceFile:617)
	at net.minecraft.server.MinecraftServer.run(SourceFile:576)
	at java.lang.Thread.run(Thread.java:745)

Linked issues

Attachments

Comments 8

Could be related to villagers sweating during a raid, but it looks like no raid is happening here.

Confirming for 18w47b.
Also, it seems to happen when the villager is not part of a village. Could be because it's checking for a raid but assumes a village exists.
Place a villager in a superflat world and it won't open. Build a simple house nearby and it will open. Remove the doors of the house and it won't open.

When the trade window doesn't open this error also appears in the log:

Error executing task
java.lang.NullPointerException
	at aqb.a(SourceFile:285)
	at agp.b(SourceFile:978)
	at aqg.a(SourceFile:1091)
	at ux.a(SourceFile:1191)
	at nn.a(SourceFile:69)
	at nn.a(SourceFile:13)
	at jq.a(SourceFile:15)
	at jq$$Lambda$2279/918034632.run(Unknown Source)
	at qp.run(SourceFile:18)
	at net.minecraft.server.MinecraftServer.q(SourceFile:646)
	at net.minecraft.server.MinecraftServer.p(SourceFile:617)
	at net.minecraft.server.MinecraftServer.run(SourceFile:576)
	at java.lang.Thread.run(Thread.java:745)

How to reproduce (copied from now duplicate MC-140266):

1) Place a door with a roof block adjacent & above it to make it a house
2) Spawn a villager in the area and wait a few seconds for him to detect the door
3) Open its GUI (notice this works as expected)
4) Place or push another block on the other side of the door to make it invalid again
5) Open the villager's GUI after a few seconds (still works)
6) Replace the door
7) Open the villager's GUI after a few seconds (nothing happens)

Can confirm for 18w48a.

Cannot reproduce in 18w49a. Trade window still opens after no doors are present.

Seems to be working 18w49a

hurdofchris

coschevi

Confirmed

Minecraft 18w47a, Minecraft 18w47b, Minecraft 18w48a, Minecraft 18w48b

Minecraft 18w49a

Retrieved