-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Is your feature request related to a problem?
I want to be able to track the owner of a minecart for a protection plugin. If the dispenser has an owner, it should be transferred over to the minecart as well. For this, I need access to the dispenser and minecart simultaneously, which is currently not straightforward.
Describe the solution you'd like.
Either an extension of BlockDispenseEvent (akin to BlockDispenseArmorEvent) that contains an entity or a new event (as was proposed in #10669 and #7377)
Describe alternatives you've considered.
Listen to BlockDispenseEvent, check if the item is Material.MINECART, Material.CHEST_MINECART, Material.FURNACE_MINECART, Material.TNT_MINECART, Material.HOPPER_MINECART, or Material.COMMAND_BLOCK_MINECART, take the velocity vector and reinterpret it as a location (because despite saying it's a velocity vector, it's actual a location coordinate) and store it, listen to VehicleCreateEvent during the same tick, check if the spawned vehicle's location matches the velocity vector and assume it's the same one (because there are no spawn reasons)