[SPIGOT-3136] Breaking a hopper (in a inventory move event) crashes server. Created: 18/Mar/17  Updated: 18/Mar/17  Resolved: 18/Mar/17

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Shane Martin Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: Crash, Event, Hopper, Inventory, Move
Environment:

Latest Spigot

18.03 14:29:32 [Server] INFO This server is running CraftBukkit version git-Spigot-96235ab-2aa5ac6 (MC: 1.11.2) (Implementing API version 1.11.2-R0.1-SNAPSHOT) 18.03 14:29:32 [Server] INFO Checking version, please wait... 18.03 14:29:33 [Server] INFO You are running the latest version


Plugin: custom

 Description   

 

The following code crashes the server when used in a listener.

http://pastebin.com/E2j9TU5L

 

It happens 100% of the time if you place a hopper directly under a chest, if you place the hopper first then a chest over it, it appears to function as expected without crash.

 

Code above checks to see if the inventory from is a chest or double chest, and the inventory to is a hopper, if so the event is canceled and the hopper is broken.

 

Stack Trace + Crash Report

http://pastebin.com/jBAsMcPX



 Comments   
Comment by md_5 [ 18/Mar/17 ]

I cannot reproduce this placing a hopper directly under a chest.
The hopper breaks as expected in both Spigot and CraftBukkit.

Comment by Shane Martin [ 18/Mar/17 ]

Heh, that is a fair point.   I thought it might be worth mentioning since it does not seem to crash the server with the exact same code if you place a chest OVER a hopper, only if you place a hopper under a chest.

Comment by md_5 [ 18/Mar/17 ]

You're gonna have a bad time deleting a hopper during its own event.

Generated at Tue Apr 22 05:22:30 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.