Custom Conditions - souppCodez/Palladium-Wiki-Enhancements GitHub Wiki
This page of the wiki will show you how to make a custom condition. Custom conditions are made using KubeJS scripts.
- Make a file in the addon scripts directory.
- Add the code to register the condition.
StartupEvents.registry('palladium:condition_serializer', (event) => {
// ID of the condition will be: 'kubejs:mycoolpack/mycoolcondition'
event.create('mycoolpack/mycoolcondition')
});
- Add the condition handler.
StartupEvents.registry('palladium:condition_serializer', (event) => {
event.create('mycoolpack/mycoolcondition')
// Handler for the condition, in this case, the condition will be fulfilled when the entity is crouching
.test((entity) => {
return entity.isCrouching();
});
});