The IEventManager is what you’re gonna need when dealing with event handlers.

Importing the class

It might be required for you to import the class if you encounter any issues.

Calling the event manager

You can access the event manager using the global events field

How do events work?

You can add a function that represents the event and from there on you can decide what you want CrT to do if such an event occurs.
The most important thing to remember is that you need to CAST THE EVENT TO IT’S TYPE! as otherwise you will not be able to access any if it’s ZenGetters.
If you simply want to print something where you don’t need to access the event, then it’s fine.

events.onPlayerCrafted(function(event as crafttweaker.event.PlayerCraftedEvent){
    event.player.xp += 1;

events.onPlayerLoggedIn(function(event) {
    //event instanceof Object -> No way of accessing it, so better cast!
    print("SOMEONE HAS LOGGED IN!!!");

What events are available?

The ZenMethods would be what you’ll need to call on events, the Event Class would be what you need to cast the event as.

ZenMethod Event Class Already Implemented?
onPlayerLoggedIn crafttweaker.event.PlayerLoggedInEvent
onPlayerLoggedOut crafttweaker.event.PlayerLoggedOutEvent
onPlayerCrafted crafttweaker.event.PlayerCraftedEvent
onPlayerSmelted crafttweaker.event.PlayerSmeltedEvent
onPlayerChangedDimension crafttweaker.event.PlayerChangedDimensionEvent
onPlayerRespawn crafttweaker.event.PlayerRespawnEvent
onPlayerAttackEntity crafttweaker.event.PlayerAttackEntityEvent
onPlayerBonemeal crafttweaker.event.PlayerBonemealEvent
onPlayerInteractEntity crafttweaker.event.PlayerInteractEntityEvent
onPlayerPickup crafttweaker.event.PlayerPickupEvent
onPlayerPickupItem crafttweaker.event.PlayerPickupItemEvent
onPlayerFillBucket crafttweaker.event.PlayerFillBucketEvent
onPlayerDeathDrops crafttweaker.event.PlayerDeathDropsEvent
onPlayerInteract crafttweaker.event.PlayerInteractEvent
onPlayerOpenContainer crafttweaker.event.PlayerOpenContainerEvent
onPlayerPickupXp crafttweaker.event.PlayerPickupXpEvent
onPlayerSleepInBed crafttweaker.event.PlayerSleepInBedEvent
onPlayerUseHoe crafttweaker.event.PlayerUseHoeEvent
onPlayerUseItemStart crafttweaker.event.PlayerUseItemStartEvent
onPlayerUseItemTick crafttweaker.event.PlayerUseItemTickEvent