#item creation do not work

26 messages · Page 1 of 1 (latest)

honest sigil
#

Hey, so i made 2 custom item with kubejs but when i load the game the items are not present,

this is my code:

onEvent('item.registery', event => {
    event.create('rose_quartz_alloy').displayName('Rose Quartz Alloy').rarity(2)
    event.create('technocore').displayName('T3chn0 C0r3').rarity(3)
})

and of course i made texture for them in the kubejs/asset/kubejs/item

calm fernBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

spare jungle
#

??codeblock

vernal gladeBOT
# spare jungle ??codeblock

You can write your code in a codeblock by typing it between the codeblock delimiters:

```js :arrow_left:

onEvent('recipes', e => {
e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})

``` :arrow_left:

As an example, :arrow_up: will look like this:

onEvent('recipes', e => {
  e.smelting('minecraft:glass', '#forge:sand').xp(.1)
})
spare jungle
honest sigil
#

still don't work

spare jungle
#

send your script and

vernal gladeBOT
#

Please send your startup.txt log file.
You can find it here: minecraft/logs/kubejs/startup.txt

spare jungle
#

by the way

#

did you restart your game?

honest sigil
#

yes, the block did work tho

#

but not the items

spare jungle
#

I see the issue

#

you have the eventitem.registery

#

it should be item.registry

honest sigil
#
onEvent('block.registry', event => {
    // Register new blocks here
     event.create('insanium_growth_accelerator').material('stone').hardness(5.0).displayName('Insanium Growth Accelator')

     event.create('polishedrosequartzblock').material('glass').hardness(0.5).displayName('Polished Rose quartz block').requiresTool(false).opaque(false)

     event.create('rose_quartz_alloy_block').material('stone').hardness(5.0).displayName('Rose quartz alloy block').requiresTool(false).opaque(false).rarity(epic)
})


onEvent('item.modification', event => {
    event.modify('kubejs:insanium_growth_accelerator', item => {
      item.maxStackSize = 16
      item.rarity = 3
    })
  })


onEvent('item.registery', event => {
    event.create('rose_quartz_alloy').displayName('Rose Quartz Alloy').rarity(rare)
    event.create('technocore').displayName('T3chn0 C0r3').rarity(epic)
})


onEvent('item.tooltip', tooltip => {

    tooltip.add('kubejs:rose_quartz_alloy_block', ["Too heavy !"])
    tooltip.add('kubejs:technocore', ["Blip Bloup Blip"])
    tooltip.add('kubejs:polishedrosequartzblock', ["So Shiny!"])
    tooltip.add('kubejs:insanium_growth_accelerator', ["This is a block to use in machine only, it will not affect crops like a regular Growth Accelerator"])
    })


spare jungle
honest sigil
#

ho i see

vernal gladeBOT
#

[Quote ➤](#1127598844188840076 message) it should be item.registry

spare jungle
#

tooltips should be in client scripts

honest sigil
#

and now it's works, but i've just got one item on the 2

spare jungle
#

because the rarities should be strings

#

like this:

onEvent('item.registry', event => {
    event.create('rose_quartz_alloy').displayName('Rose Quartz Alloy').rarity('rare')
    event.create('technocore').displayName('T3chn0 C0r3').rarity('epic')
})
honest sigil
#

Okay everything works now !

#

Thank you a lot !

spare jungle
#

:D