Posted April 15, 20205 yr I'm trying to come up with a way to create multiblock structures where a controller block will be notified when any of the slave blocks in the structure is broken. Is it possible to do this using vanilla blocks as slaves? I've read a bit of the Tinkers' Construct approach to multiblocks, but part of its method uses TileEntities for every slave block. This means that it wouldn't be possible to use blocks without tile entities in the structure using this approach (for instance, using wooden planks as part of the building). To be more precise in what I'm looking for, I'm trying to transform buildings into multiblock structures. Inside the building there must be a controller block. Whenever any of the blocks of the structure is broken, the structure will lose health (which I guess would be stored in the TileEntity) and the broken block will come back to its place. When the structure's health reaches zero, it will be removed. What are some other approaches to multiblock structures that could work? What other mods use multiblock structures? Do any use vanilla blocks as slaves? Thanks
April 15, 20205 yr I would suggest looking into the Patchouli by Vazkii which provides a multiblock solution you are looking for.
April 15, 20205 yr Author Just now, CHEESEBOT314 said: I would suggest looking into the Patchouli by Vazkii which provides a multiblock solution you are looking for. Doesn't seem to be what I'm looking for. Though this allows vanilla multiblocks and visualization, it doesn't include a master-slave relation between blocks.
April 15, 20205 yr Howdy I think it would be possible to do this using one of the BlockEvents, eg NeighborNotifyEvent or BreakEvent. i.e. you subscribe to BreakEvent; when any block is broken, your code checks to see if it was within a multiblock structure (eg - look for controller tile entities within a given radius). If so, the controller "check your structure components, they have been changed". -TGG
April 16, 20205 yr Author Just now, TheGreyGhost said: Howdy I think it would be possible to do this using one of the BlockEvents, eg NeighborNotifyEvent or BreakEvent. i.e. you subscribe to BreakEvent; when any block is broken, your code checks to see if it was within a multiblock structure (eg - look for controller tile entities within a given radius). If so, the controller "check your structure components, they have been changed". -TGG That's great! I'll try it out.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.