Skip to content

startUsingItem and stopUsingItem methods for LivingEntity #10295

@Keisimm

Description

@Keisimm

Is your feature request related to a problem?

I needed to make a skeleton stretch its bow before invoking ProjectileSource#launchProjectile(). I analyzed the Bukkit API, but there doesn't seem to be a method for this purpose (or am I mistaken?). In NMS (Mojang Mappings), there's the LivingEntity#startUsingItem(InteractionHand) method - that's the solution.

Describe the solution you'd like.

Implement these methods to the Bukkit LivingEntity class:

public void startUsingItem(EquipmentSlot slot) {
if(slot == EquipmentSlot.HAND) getHandle().startUsingItem(InteractionHand.MAIN_HAND);
else if(slot == EquipmentSlot.OFF_HAND) getHandle().startUsingItem(InteractionHand.OFF_HAND);
}

public void stopUsingItem() {
getHandle().stopUsingItem();
}

Describe alternatives you've considered.

Direct use of NMS.

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.type: featureRequest for a new Feature.
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions