I would find when a dispenser shoots then either stop the item from being used or record the entity and then cancel the event and manually shoot it from the dispensers location
So it would find the dispensers location, cancel the dispenser from shooting, but recording what item it is, and than dispensing it from the dispenser's location? I think that could work, ty.
I would have listened for when it dispenses, get the item, and put the same type of item back in it. Not sure if it's possible to put items in one though, never worked with them.
no I think Jogy34's method would work better, but turns out I won't need this, I found a better way for my plugin instead of dispencers
You will need to first get the dispenser. Then you need to get the dispenser's inventory. After that on the dispense event you need to add what is being dispensed. Code: Dispenser dispenser = (Dispenser) event.getBlock(); Inventory inv = dispenser.getInventory(); inv.addItem(event.getItem());
how i do it: Code: ItemStack newItemStack = event.getItem().clone(); dispenser.getInventory().addItem(newItemStack); and it's NEVER too late to solve a post.