mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-04-25 16:37:21 +00:00
Theres documentation at https://sylvessa.zip/fourkit/ now. And a bunch of other changes. Check the discord server for a more comprehensive list
33 lines
913 B
C#
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;
|
|
}
|