Skip to content

KubeJS Support

Panderva edited this page Apr 17, 2024 · 4 revisions

Item Types

As of version 1.1.17, MIAPI adds very basic modular item types to be used in KubeJS. miapi_modular_weapon is likely the item type you would want to use if you are creating a special modular item, although it is not the only option:

  • miapi_modular_weapon
  • miapi_modular_arrow
  • miapi_modular_axe
  • miapi_modular_boots
  • miapi_modular_chestplate
  • miapi_modular_crossbow
  • miapi_modular_helmet
  • miapi_modular_hoe
  • miapi_modular_leggings
  • miapi_modular_pickaxe
  • miapi_modular_shovel
  • miapi_modular_sword

The options above should be pretty self-explanatory. They all implement special behavior respective to their names. Use the one that fits best for your needs(which, again, will most likely be the first). You can create an item with these types like you would any other KubeJS item. Simply use the item registration event in a startup script and specify one of these option's as the item's type:

StartupEvents.registry('item', e => {
  // You can specify item type as 2nd argument in create()
  e.create('cool_modular_item', 'miapi_modular_weapon')
})
Clone this wiki locally