I need some help with making my bars. So, I'm using Edds fence template, but I modified it up to myself, to make bar. What I need help with, is that I'm making copper bars, which oxidize, and so far, I've got this script. I'm not sure if it will work, so I need help. The thing is that when block changes itself to another block, I want it to keep other states it has, so this is what I did, but again, I don't know if I made it correct way at all world.beforeEvents.worldInitialize.subscribe(initEvent => { initEvent.blockTypeRegistry.registerCustomComponent('v360:copper_bars', { onTick(data) { const { block, player } = data const north = block.permutation.getState("v360:connect_north") const south = block.permutation.getState("v360:connect_south") const west = block.permutation.getState("v360:connect_west") const east = block.permutation.getState("v360:connect_east") if (north || south || west || east) { const chain = BlockPermutation.resolve('v360:exposed_copper_bar_block', { "v360:connect_north": north, "v360:connect_south": south, "v360:connect_west": west, "v360:connect_east": east }); block.setPermutation(chain); } }
#Change block with many block states
1 messages · Page 1 of 1 (latest)
just use block.json and create multiple blocks and make a random tick after time and make it 10 minutes and if 10 minutes are waited then place oxidised copper at block pos
?
wait, im confused a bit
i have copper, exposed, weathered and oxidized bars
and when, for example, copper bar on tick places on itself exposed copper bar, i just want it to save it's connection states, since exposed copper bar has the same states as regular copper one