Posted April 28, 20223 yr I have a block that is 1.5 blocks tall(by model and VoxelShape), and I want to prevent users from placing a block directly above it, as it will intersect with the block making it look really weird... So what I did is listen to RightClickEvent and cancel it if the block that will be placed by it(EntityPlaceEvent is only server side thus cancelling it still lets it happen on the client so the block is seen placed). However, I want it to automatically place a block above that block(where it doesn't interfare), I already managed to use Level.setBlock(BlockPos, BlockState, int) but this doesn't use sounds or particles or anything.. I tried using EventBus.Post on a RightClickEvent on the right block.. it did nothing.... I also wanted to try on EntityPlaceEvent but it requires a BlockSnapshot which idk how to obtain... What do I do?? My end goal is to place the block naturally(sound, particles, everything, also take one off the stack if not creative) just.. only block above my one and a half blocks tall block
April 28, 20223 yr Author I've seen models who are larger than a single block.. how do they work??? (Or, perhaps, how do I make a 2-block structure work(like a door or a bed) Edited April 28, 20223 yr by 1Mangomaster1
April 28, 20223 yr Author I actually looked at the DoorBlock and I didn't quite get it... I expected an override on onPlace() or something to place the lower/upper pieces.. but I didn't see it
April 28, 20223 yr Author I suspected soo.. I'll have to mess around with the JSON of it to understand how it works there, because I've never really done it for this kinda of thing, but I think I have an idea of how it works.. I'll update soon, thank you! Tho... how do I manage the VoxelShape here... each part of the top and bottom has a different shape(smaller than a single block).. how do I properly have each section its own shape? Edited April 28, 20223 yr by 1Mangomaster1
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.