How can I do this? As shown, it doesnt rotate.
event.create('iron_chain')
.displayName('Iron Chain')
.hardness(6)
.resistance(5)
.mapColor('NONE')
.requiresTool(true)
.soundType('chain')
.renderType('cutout')
.fullBlock(false)
.waterlogged()
.opaque(false)
.transparent(true)
.notSolid()
.suffocating(false)
.box(6.5, 0, 6.5, 9.5, 16, 9.5)
.tagBlock('minecraft:mineable/pickaxe')
.property(BlockProperties.AXIS)
.placementState(global['loglike_waterloggable'])
.blockstateJson = {
"variants": {
"axis=x": {
"model": "kubejs:block/iron_chain",
"x": 90,
"y": 90
},
"axis=y": {
"model": "kubejs:block/iron_chain"
},
"axis=z": {
"model": "kubejs:block/iron_chain",
"x": 90
}
}
}
JsonIO.write('kubejs/assets/kubejs/models/block/iron_chain.json', {
"parent": 'minecraft:block/chain',
"textures": {
"all": 'kubejs:block/iron_chain',
"particle": '#all'
}
})
JsonIO.write(`kubejs/assets/kubejs/models/item/iron_chain.json`, {
"parent": "minecraft:item/generated",
"textures": {
"layer0": "kubejs:item/iron_chain"
}
})
global['loglike_waterloggable'] = context => {
const $Fluids = Java.loadClass("net.minecraft.world.level.material.Fluids")
let isInWater = context.getLevel().getFluidState(context.getClickedPos()).getType() == $Fluids.WATER
context.set(BlockProperties.AXIS, context.clickedFace.axis)
context.set(BlockProperties.WATERLOGGED, isInWater)
}