Skip to content

Event for when a dispenser creates entities #13302

@rymiel

Description

@rymiel

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)

Other

Prior work on this issue has been done in #10669 and #7377

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions