#Trying to add SoundType.CHAIN sound to my custom block

5 messages · Page 1 of 1 (latest)

candid oasis
#

I am trying to make my block use the chain sound. Here is my script

const MaterialJS = java("dev.latvian.mods.kubejs.block.MaterialJS")
const Material = java('net.minecraft.world.level.material.Material')
const SoundType = java('net.minecraft.world.level.block.SoundType')

let scrapMetal = new MaterialJS('scrap', Material.DIRT, SoundType.CHAIN)

onEvent('block.registry', event => {
event.create('scrap').material('scrapMetal').displayName("Scrap").tagBlock('minecraft:mineable/shovel').defaultCutout().box(0,0,0,16,3,16, true).requiresTool(false);
})

For some reason when I run this script, my 'scrap' block sounds like oak wood.
Does anyone know what si wrong with the script i've posted?

lean hamletBOT
#

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

median pelican
#

try removing the quotes around scrapMetal in .material()

candid oasis
#

ahhh duh lol, let me see if it works now

#

Ty, works now