#is it possible to make the `minecraft:brick` item act as a placeable block?

13 messages · Page 1 of 1 (latest)

sick otterBOT
#

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

half scarab
#

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

hidden sphinx
#

what would a script to make a pre-existing item placeable similar to grass even look like?

celest rock
#

BlockEvents.rightClicked in server events might be what youre looking for

storm plover
#

@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

hidden sphinx
#

perfect, ill see if it works when i get home at <t:1730485800>

hidden sphinx
#

Well, heres one problem: it inherits almost all properties of the block

#

second problem:

storm plover
#

try .defaultCutout() in the block builder

hidden sphinx
#

also, it completeley overrides custom items

storm plover
#

wym?