Create a Custom Gateway Pearl with JavaScript
Setting Up Your Gateway Pearl Script
Gateway Pearls are the items that trigger your custom arenas. To create one, you'll write a KubeJS script that defines its properties, appearance, and wave behavior.
Start by registering a new gateway pearl in your KubeJS server_scripts folder. Use the mod's gateway pearl builder to set:
- Display name and color – customize how it appears in your inventory
- Size and scale – control the arena dimensions
- Wave lineup – define which mobs spawn and in what order
- Arena rules – set conditions like time limits or mob caps
Configuring Waves and Rewards
Within your pearl script, attach wave data using event listeners. Each wave can specify entity types, spawn counts, and difficulty modifiers. Use Entity Modifiers to add potion effects or custom gear to spawned mobs.
Link a reward pool to your gateway so players receive loot after clearing waves. You can make rewards dynamic—different items drop based on which wave was completed or how quickly players finished.
Test your pearl by placing it in the world and triggering the gateway. Check the console for script errors and adjust mob counts or timings as needed.