Change Item

Raising

This Event is raised when someone Equips another Item

Usage

Commonly Used for Custom Items to notify the Player that this is a Custom Item

ChangeItemEvent

EventArgsTypeDescription

Player

SynapsePlayer

The Player who changes his equipped Item

Allow

bool

If the Player is Allowed to Change his Item

PreviousItem

SynapseItem

The Item the Player currently holds

NewItem

SynapseItem

The Item the Players wants to equip

public class ChangeItemEvent : PlayerInteractEvent
{
    public ChangeItemEvent(SynapsePlayer player, bool allow, SynapseItem newItem) : base(player, allow)
    {
        NewItem = newItem;
    }

    public SynapseItem PreviousItem => Player.Inventory.ItemInHand;
    
    public SynapseItem NewItem { get; }
}

Last updated