CommandHelper

CommandHelper

46.5k Downloads

block_dispense event crash

LadyCailinBot opened this issue ยท 3 comments

commented

CMDHELPER-2929 - Reported by Mrfrase.III

Doing modify_event(item, null) in a block_dispense event will crash the server. (not much else to it)

Doing this is meant to either just cancel the event, delete the item, or throw an error saying to use cancel() or take_from_inventory().

commented

Comment by PseudoKnight

Confirmed.

	at net.minecraft.server.v1_7_R2.DispenseBehaviorItem.a(DispenseBehaviorItem.java:72)
	at net.minecraft.server.v1_7_R2.DispenseBehaviorItem.b(DispenseBehaviorItem.java:26)
	at net.minecraft.server.v1_7_R2.DispenseBehaviorItem.a(DispenseBehaviorItem.java:13)
	at net.minecraft.server.v1_7_R2.BlockDispenser.dispense(BlockDispenser.java:82)
	at net.minecraft.server.v1_7_R2.BlockDispenser.a(BlockDispenser.java:110)
	at net.minecraft.server.v1_7_R2.WorldServer.a(WorldServer.java:567)
	at net.minecraft.server.v1_7_R2.WorldServer.doTick(WorldServer.java:210)
	at net.minecraft.server.v1_7_R2.MinecraftServer.v(MinecraftServer.java:662)
	at net.minecraft.server.v1_7_R2.DedicatedServer.v(DedicatedServer.java:273)
	at net.minecraft.server.v1_7_R2.MinecraftServer.u(MinecraftServer.java:566)
	at net.minecraft.server.v1_7_R2.MinecraftServer.run(MinecraftServer.java:472)
	at net.minecraft.server.v1_7_R2.ThreadServerApplication.run(SourceFile:618)```
commented

Comment by LadyCailin

Fixed with PR 273

commented

Comment by PseudoKnight

To clarify, it now throws a helpful exception when you try to set it to null or air. It's a Bukkit issue or limitation that you'll have to workaround yourself.