#is it possible to make the `minecraft:brick` item act as a placeable block?
13 messages · Page 1 of 1 (latest)
i think it's possible, but there's a lot of work, especially it's a startup script
you might have to do most of the work yourself
what would a script to make a pre-existing item placeable similar to grass even look like?
BlockEvents.rightClicked in server events might be what youre looking for
@hidden sphinx what you want to do is overwrite the item which will automatically correlate a block for it which you can then place down. This is made possible with event.createCustom ```js
const $BlockItem = Java.loadClass('net.minecraft.world.item.BlockItem')
const $IProperties = Java.loadClass('net.minecraft.world.item.Item$Properties')
StartupEvents.registry('block', e => {
e.create("kubejs:brick")
})
StartupEvents.registry('item', e => {
e.createCustom('minecraft:brick', () => new $BlockItem(Block.id("kubejs:brick"), new $IProperties()))
})
we're able to do this because of forge's registry overwriting functionality basically converting a brick into a BlockItem
perfect, ill see if it works when i get home at <t:1730485800>
Well, heres one problem: it inherits almost all properties of the block
second problem:
try .defaultCutout() in the block builder
also, it completeley overrides custom items
wym?