Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

110 total results found

FTB Utilities Rank Promotions

KubeJS Legacy Examples

With this script you can have FTB Utilities roles that change over time. Is for 1.12 only. Requires FTB Utilities. events.listen('player.tick', function (event) { // This check happens every 20 ticks, a.k.a every second if (event.player.server &&am...

Addons

KubeJS

Clearlag 1.12

KubeJS Legacy Examples

This script removes all items from world every 30 minutes. Only works in 1.12. // Create item whitelist filter that won't be deleted with clearlag var whitelist = Ingredient.matchAny([ 'minecraft:diamond', // Adds diamond to whitelist 'minecraft:gold_i...

Getting Started

KubeJS Legacy

A step by step guide for learning the basics of KubeJS

Intro

KubeJS

Intro

KubeJS Legacy

FAQ What does this mod do? This mod lets you create scripts in JavaScript language to manage your server, add new blocks and items, change recipes, add custom handlers for quest mods and more! How to use it? Run the game with mod installed once. It should ...

EventJS

KubeJS Legacy Events

This event is the most basic event class, parent of all other events. Parent class Object Can be cancelled No Variables and Functions Name Return Type Info cancel() void Cancels event. If the event can't be cancelled, it won't do anything.

CommandEventJS

KubeJS Legacy Events

This event needs cleanup! Using it is not recommended. Information This event is fired when a command is executed on server side. Parent class EventJS Can be cancelled Yes Variables and Functions Name Type Info parseResults ParseResul...

List of all events

KubeJS Legacy Events

This is a list of all events. It's possible that not all events are listed here, but this list will be updated regularly. Click on event ID to open it's class and see information, fields and methods. Type descriptions: Startup: Scripts go in kubejs/startu...

TagEventJS

KubeJS Legacy Events

This event is fired when a tag collection is loaded, to modify it with script. You can add and remove tags for items, blocks, fluids and entity types. This goes into server scripts. Tags are per item/block/fluid/entity type and as such cannot be added based ...

RecipeEventJS

KubeJS Legacy Events

Examples The most basic script to add a single recipe: onEvent('recipes', event => { event.shaped('3x minecraft:stone', [ 'SAS', 'S S', 'SAS' ], { S: 'minecraft:sponge', A: 'minecraft:apple' }) }) The most basic script to ...

Object

KubeJS Legacy Classes

Parent class of all Java objects.  Parent None (and itself at the same time, don't question it) Variables and Functions Name Type Info toString() String Tag collection type. equals(Object other) boolean Checks equality with another object. ...

String

KubeJS Legacy Classes

Class of string objects, such as "abc" (and in JS 'abc' works as well)  Parent Object Variables and Functions Name Type Info empty boolean Returns if string is empty a.k.a string === '' toLowerCase() String Returns a copy of this stri...

Primitive Types

KubeJS Legacy Classes

Information Primitive types are objects that don't have a real class and don't inherit methods from Object. All primitive types Type Java class Info void Void No type byte Byte 8 bit decimal number. short Short 16 bit decimal number. ...

Scheduled Server Events

KubeJS Legacy Examples

At server load, you can schedule anything to happen at later time. Within callback handler you can also call callback.reschedule() to repeat this event after initial timer or callback.reschedule(newTime) to change it. Whatever you pass as 2nd argument will be...

FTB Quests Integration

KubeJS Legacy Examples

onEvent('ftbquests.custom_task.75381f79', event => { log.info('Custom task!') event.checkTimer = 20 event.check = (task, player) => { if (player.world.daytime && player.world.raining) { task.progress++ } } }) onEv...

JEI Integration

KubeJS Legacy Events

All JEI events are client sided and so go in the client_scripts folder Sub-types onEvent('jei.subtypes', event => { event.useNBT('example:item') event.useNBTKey('example:item', 'type') }) Hide Items & Fluids onEvent('jei.hide.items', event =&...

REI Integration

KubeJS Legacy Events

Note: REI integration only works on Fabric in 1.16. In 1.18+, it works on both Forge and Fabric! All REI events are client sided and so go in the client_scripts folder For 1.19+, see below (this is a temporary page!) Hide Items onEvent('rei.hide.items', ev...