-
Notifications
You must be signed in to change notification settings - Fork 11
Custom Conditions
Lucraft edited this page Jan 17, 2023
·
1 revision
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();
});
});