MinecraftConsoles/Minecraft.Server.FourKit/Event/Player/PlayerInteractEntityEvent.cs
sylvessa f5f9aa1cf5 finish rewrite; port to cmake, loads of other changes
Theres documentation at https://sylvessa.zip/fourkit/ now. And a bunch of other changes. Check the discord server for a more comprehensive list
2026-03-21 14:01:49 -05:00

33 lines
913 B
C#

namespace Minecraft.Server.FourKit.Event.Player;
using Minecraft.Server.FourKit.Entity;
/// <summary>
/// Represents an event that is called when a player right clicks an entity.
/// </summary>
public class PlayerInteractEntityEvent : PlayerEvent, Cancellable
{
/// <summary>The entity that was right-clicked.</summary>
protected Entity clickedEntity;
private bool _cancelled;
internal PlayerInteractEntityEvent(Player who, Entity clickedEntity)
: base(who)
{
this.clickedEntity = clickedEntity;
}
/// <inheritdoc/>
public bool isCancelled() => _cancelled;
/// <inheritdoc/>
public void setCancelled(bool cancel) => _cancelled = cancel;
/// <summary>
/// Gets the entity that was right-clicked by the player.
/// </summary>
/// <returns>entity right clicked by player</returns>
public Entity getRightClicked() => clickedEntity;
}