KubeJS

KubeJS

107M Downloads

[KJS 7.2] Component "custom_object" is not working

pietro-lopes opened this issue ยท 7 comments

commented

Minecraft Version

1.21.1

KubeJS Version

2101.7.2-build.265

Rhino Version

2101.2.7-build.77

Architectury Version

NA

Forge/Fabric Version

21.1.209

Describe your issue

Mods required: Actually Additions

Files at kubejs/data/ folder
kubejs\data\actuallyadditions\kubejs\recipe_components.json

{
  "actuallyadditions:effect": {
    "type": "custom_object",
    "keys": [
      {
        "name": "effect",
        "component": {
          "type": "registry_element",
          "registry": "mob_effect"
        }
      },
      {
        "name": "duration",
        "component": "ticks"
      },
      {
        "name": "amplifier",
        "component": "non_negative_int"
      }
    ]
  }
}

kubejs\data\actuallyadditions\kubejs\recipe_schema\coffee_ingredient.json

{
  "keys": [
    {
      "name": "ingredient",
      "role": "input",
      "type": "ingredient"
    },
    {
      "name": "max_amplifier",
      "type": "non_negative_int"
    },
    {
      "name": "effects",
      "type": {
        "type": "list",
        "component": "actuallyadditions:effect"
      },
      "default_optional": true
    },
    {
      "name": "extra_text",
      "role": "other",
      "type": "optional_string",
      "default_optional": true
    }
  ],
  "unique": ["ingredient"]
}

kubejs\server_scripts\main.js

ServerEvents.recipes(event => {
  event.forEachRecipe({output: "minecraft:acacia_boat"}, event => {})
})

ServerEvents.recipes(event => {
  event.recipes.actuallyadditions.coffee_ingredient("minecraft:apple", 5).effects([{"effect":"minecraft:health_boost","amplifier":2,"duration":107},{"effect":"minecraft:fire_resistance","amplifier":0,"duration":125},{"effect":"minecraft:haste","amplifier":4,"duration":177},{"effect":"minecraft:dolphins_grace","amplifier":1,"duration":84},{"effect":"minecraft:strength","amplifier":5,"duration":180}])
})

Crash report/logs

https://gnomebot.dev/paste/mclogs/GfDBkbk

commented

Minecraft Version

1.21.1

KubeJS Version

2101.7.2-build.265

Rhino Version

2101.2.7-build.77

Architectury Version

NA

Forge/Fabric Version

21.1.209

Describe your issue

Mods required: Actually Additions

Files at kubejs/data/ folder kubejs\data\actuallyadditions\kubejs\recipe_components.json

{
"actuallyadditions:effect": {
"type": "custom_object",
"keys": [
{
"name": "effect",
"component": {
"type": "registry_element",
"registry": "mob_effect"
}
},
{
"name": "duration",
"component": "ticks"
},
{
"name": "amplifier",
"component": "non_negative_int"
}
]
}
}
kubejs\data\actuallyadditions\kubejs\recipe_schema\coffee_ingredient.json

{
"keys": [
{
"name": "ingredient",
"role": "input",
"type": "ingredient"
},
{
"name": "max_amplifier",
"type": "non_negative_int"
},
{
"name": "effects",
"type": {
"type": "list",
"component": "actuallyadditions:effect"
},
"default_optional": true
},
{
"name": "extra_text",
"role": "other",
"type": "optional_string",
"default_optional": true
}
],
"unique": ["ingredient"]
}
kubejs\server_scripts\main.js

ServerEvents.recipes(event => {
event.forEachRecipe({output: "minecraft:acacia_boat"}, event => {})
})

ServerEvents.recipes(event => {
event.recipes.actuallyadditions.coffee_ingredient("minecraft:apple", 5).effects([{"effect":"minecraft:health_boost","amplifier":2,"duration":107},{"effect":"minecraft:fire_resistance","amplifier":0,"duration":125},{"effect":"minecraft:haste","amplifier":4,"duration":177},{"effect":"minecraft:dolphins_grace","amplifier":1,"duration":84},{"effect":"minecraft:strength","amplifier":5,"duration":180}])
})

Crash report/logs

https://gnomebot.dev/paste/mclogs/GfDBkbk

Kubejs 7.2 is not out yet. It works on the latest build of 1.21.1.

commented

I use kubejs actually additions and it works

commented

They did the anouncement for people to test and report bugs, they will release next week.

And actually additions is just being used as an example that I can use this custom_object

commented

They did the anouncement for people to test and report bugs, they will release next week.

And actually additions is just being used as an example that I can use this custom_object

Can you give me the link??? or where they said it?

commented

They said it in a private channel for modpack developers and addon developers

commented

Temp fixed on KubeJS Tweaks

commented

Fixed