跳到正文

KubeJS Chest Item

作者:YTGLD82925

Added KubeJS compatibility for Chest Curio Item

收藏

截图

介绍

中文介绍正在准备中,下面暂时显示原文。

This mod allows using KubeJS scripts to create some new chest curios.

Supported item types:

  • Normal Curios
StartupEvents.registry('item', event => {
    event.create('item_id', 'chest_item:item_base')
        .displayName('itemName')
        .maxStackSize(1)
        .addAttribute(
            'minecraft:generic.max_health',
            'chest_item:item_max_health',
            0.2,
            'add_multiplied_base'
        )
        .texture('modid:item/texture')
})
  • Shadow Curios
StartupEvents.registry('item', event => {
    event.create('item_id', 'chest_item:item_black_shadow')
        .displayName('itemName')
        .maxStackSize(1)
       .addAttribute(
            'chest_item:shadow_shield',
            'chest_item:item_shadow_shield',
            4,
            'add_value'
        )
        .texture('modid:item/texture')
  • Augments
StartupEvents.registry('item', event => {
    event.create('item_id', 'chest_item:reinforced_item')
        .displayName('itemName')
        .loot(false)  // Should I add it to the loot table
        .valueSan(2)  //Rationality value
        .addAttribute(
            'minecraft:generic.max_health',
            'chest_item:item_shadow_shield',
            -0.1,
            'add_multiplied_total'
        )
        .maxStackSize(1)
        .texture('modid:item/texture')
})
  • Mother Evil Curios
StartupEvents.registry('item', event => {
    event.create('item_id', 'chest_item:evil_mother')
        .displayName('itemName')
        .valueSan(-3)  //Rationality value
        .maxStackSize(1)
        .texture('modid:item/texture')
})
  • Bottles (and associated Faiths)
StartupEvents.registry('item', event => {
    event.create('bottle_id', 'chest_item:memory')
        .displayName('bottle')
        .setMemoryString("kubejs","memory_id")
        .maxStackSize(1)
        .texture('modid:item/texture')
})
//You must create an additional item
//This ID must correspond to the above code
StartupEvents.registry('item', event => {
    event.create('memory_id', 'chest_item:memory_tooltip')
        .displayName('memoryName')
        .setComponent("Large characters")
        .setComponentText("small characters")
        .setColor(0xffffff)
        .maxStackSize(1)
        .texture('modid:item/texture')
})

This mod also adds some predicate methods to check whether the player is wearing the relevant curios, augments or Faiths:

  if (ChestKubeJSHandler.has(player,Item.of('modid:item'))) {
      //Your specific implementation method
  }
  if (ChestKubeJSHandler.hasReinforced(player,Item.of('modid:item'))){
      //Your specific implementation method
  }
  if (ChestKubeJSHandler.hasMemory(player, "modid:item")) {
      //Your specific implementation method
  }

常见问题

KubeJS Chest Item 支持哪些 Minecraft 版本?

KubeJS Chest Item 支持 Minecraft Java 版 1.21.1,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。

KubeJS Chest Item 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

YTGLD82925 的其他作品

查看全部 →