When creating your mod with the CustomNPCs API you will want to:
@Mod(modid = YourMod.MODID, version = YourMod.VERSION, dependencies = "after:customnpcs")
or if its required:
@Mod(modid = YourMod.MODID, version = YourMod.VERSION, dependencies = "required-after:customnpcs")
To make sure CustomNPCs is loaded first.
Simple event handler:
public class CustomNPCEventHandler { @SubscribeEvent public void onInteract(NpcEvent.InteractEvent event){ //your code } }
To register your event handler:
NpcAPI.Instance().events().register(new CustomNPCEventHandler());