is it possible to create a block that can't be pushed by pistons and such?
i've searched through this server for posts about this and not a single one of them has had a conclusive answer - which seems really odd because this doesn't sound like it should be something that's crazy hard to do...?
i'd really like a proper answer for this, it's been frustrating finding nothing on the matter
#Immovable blocks
9 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
something like this should do it, what you're mainly after is setting the .pushReaction("block") js const $TintedGlassBlock = Java.loadClass('net.minecraft.world.level.block.TintedGlassBlock') const $Blocks = Java.loadClass('net.minecraft.world.level.block.Blocks') const $Properties = Java.loadClass('net.minecraft.world.level.block.state.BlockBehaviour$Properties') const $BlockItem = Java.loadClass('net.minecraft.world.item.BlockItem') const $IProperties = Java.loadClass('net.minecraft.world.item.Item$Properties') // Block let darkGlass StartupEvents.registry('block', e => { darkGlass = e.custom('dark_glass', new $TintedGlassBlock($Properties.of().pushReaction("block"))) }) // Item StartupEvents.registry('item', e => { e.custom('dark_glass', new $BlockItem(darkGlass.get(), new $IProperties())) // BlockItem (delete this line if you just want a block without item) })
i've just tried doing this:
const $SturdyBlock = Java.loadClass('net.minecraft.world.level.block.TintedGlassBlock')
const $Blocks = Java.loadClass('net.minecraft.world.level.block.Blocks')
const $BlockProperties = Java.loadClass('net.minecraft.world.level.block.state.BlockBehaviour$Properties')
const $BlockItem = Java.loadClass('net.minecraft.world.item.BlockItem')
const $ItemProperties = Java.loadClass('net.minecraft.world.item.Item$Properties')
let sturdyBlackstone
StartupEvents.registry('block', e => { sturdyBlackstone = e.custom('sturdy_blackstone', new $SturdyBlock($BlockProperties.of().pushReaction("block"))) })
StartupEvents.registry('item', e => { e.custom('sturdy_blackstone', new $BlockItem(sturdyBlackstone.get(), new $ItemProperties())) })```
and it gave me uh, this
try this ```js
const $SturdyBlock = Java.loadClass('net.minecraft.world.level.block.TintedGlassBlock')
const $Blocks = Java.loadClass('net.minecraft.world.level.block.Blocks')
const $BlockProperties = Java.loadClass('net.minecraft.world.level.block.state.BlockBehaviour$Properties')
const $BlockItem = Java.loadClass('net.minecraft.world.item.BlockItem')
const $ItemProperties = Java.loadClass('net.minecraft.world.item.Item$Properties')
const $Material = Java.loadClass('net.minecraft.world.level.material.Material')
let /**@type {Internal.CustomBuilderObject} */ sturdyBlackstone
StartupEvents.registry('block', e => {
e.createCustom('sturdy_blackstone', () => new $SturdyBlock($BlockProperties.of($Material.PISTON)))
})
StartupEvents.registry('item', e => {
e.createCustom('sturdy_blackstone', () => new $BlockItem(Block.getBlock("kubejs:sturdy_blackstone"), new $ItemProperties()))
})```