Trying to get all the tags from a block in order to add them to another block, but I'm struggling to get it to work. This is my current code (which is kind of jank) along with the errpr it gives me
const $Registry = Java.loadClass("net.minecraft.core.Registry")
ServerEvents.tags('block', event => {
$Registry.BLOCK.getTagNames().map(key => key.location()).forEach(rLoc => {
console.log(rLoc)
if(event.get(rLoc).getObjectIds().contains('minecraft:ice')) {
console.log('tag contains ice')
event.add(rLoc, 'ecologics:thin_ice')
event.add(rLoc, 'immersiveweathering:thin_ice')
}
})
})
