ItemEvents.entityInteracted((event) =>
{
    const player = event.player;
    if(!player || !event.target)
    {
        return;
    }

    const entityId = event.target.type;
    if(!global.tfc_classes_util.checkIncludes(global.tfc_classes_involved.entities, entityId))
    {
        return;
    }

    const playerClass = global.tfc_classes_util.getClassOfPlayer(player);
    if(!playerClass)
    {
        player.displayClientMessage(Component.red("You cannot use this entity because you do not have a class selected."), true);
        event.cancel();
        return;
    }

    if(!global.tfc_classes_util.checkIncludes(playerClass.allowed_entities, entityId))
    {
        player.displayClientMessage(Component.red("You cannot use this entity because you are a " + playerClass.id), true);
        event.cancel();
    }
});