Let Hopper interact with blocks

Discussion in 'Spigot Plugin Development' started by tr7zw, May 19, 2015.

  1. I'm currently trying to think of a way to let hoppers interact with non container blocks. For example that if I place a hopper under a log it "pulls" out items from the logs "inventory". (And from the sides/above the hopper places items in the "inventory")
    How could you trick hoppers to do so? Using a hopper event to simulate this behaviour or changing the log to a custom block with a "container"?
    - tr7zw
  2. Well you could make a arraylist or something to store a hoppers location and use a while loop to check if there is a log above you can make that block break and add it to hashmap<Location, Inventory> and when someone opens the hopper it will contain te inventory

    I am just thinking out loud now

    sorry for bad english
  3. or modify the hopper's code. Probably works a bit better, aside that you have to depend on NMS.