#Registering two blocks

19 messages · Page 1 of 1 (latest)

formal dust
#

Whichever one is on top is the only one added :/

static wyvernBOT
#

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

ebon oakBOT
#

🗒️ Send the code! 🗒️

You may have an issue with a KubeJS script and you explain it to the best of your ability yet without the actual code in question we have very little to go off of in trying to assist you.

#

Please send your KubeJS server log. It can be found at /minecraft/logs/kubejs/server.log.
If you are on 1.18 or 1.16 it will be called server.txt.
Please send the file directly, without links or snippets.

formal dust
ebon oakBOT
#

Paste version of message.txt from @formal dust

formal dust
#

@onyx totem

#

(also ping for reply)

onyx totem
#

i realized i asked for the wrong log

ebon oakBOT
#

Please send your KubeJS startup log. It can be found at /minecraft/logs/kubejs/startup.log.
If you are on 1.18 or 1.16 it will be called startup.txt.
Please send the file directly, without links or snippets.

formal dust
#

oh okay one sec

formal dust
# onyx totem i realized i asked for the wrong log
[18:19:21] [INFO ] Loaded script startup_scripts:script.js in 0.136 s
[18:19:21] [INFO ] Loaded 1/1 KubeJS startup scripts in 0.874 s
[18:19:21] [ERR  ] Error occurred while handling event 'block.registry': TypeError: Cannot find function soundType in object dev.latvian.mods.kubejs.block.custom.BasicBlockJS$Builder@791f68eb. (startup_scripts:script.js#26)```
#

and

#
onEvent('block.registry', event => {
    event.create('glitter_block').displayName('Block of Glitter').soundType('sand').hardness(1.0).resistance(1.0).textureAll('kubejs:block/glitter_block')

    event.create('creative_block').displayName('Block of Creative').soundType('heavy_metal').hardness(1.0).resistance(1.0).textureAll('kubejs:block/creative_block').tagBlock('my_custom_tag').requiresTool(true).tagBlock('my_namespace:my_other_tag').tagBlock('minecraft:mineable/axe').tagBlock('minecraft:mineable/pickaxe').tagBlock('minecraft:needs_iron_tool')
    
    event.create('example_block').material('wood').hardness(1.0).displayName('Example Block')
})```
onyx totem
#

where did you get sound type from hmmm

#

ah nvm

#

try this

onEvent('block.registry', event => {
    event.create('glitter_block').displayName('Block of Glitter').material('sand').hardness(1.0).resistance(1.0)
    event.create('creative_block').displayName('Block of Creative').material('heavy_metal').hardness(1.0).resistance(1.0).tagBlock('my_custom_tag').requiresTool(true).tagBlock('my_namespace:my_other_tag').tagBlock('minecraft:mineable/axe').tagBlock('minecraft:mineable/pickaxe').tagBlock('minecraft:needs_iron_tool')
    
    event.create('example_block').material('wood').hardness(1.0).displayName('Example Block')
})
formal dust
#

tysm!!