Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • 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 by 1Mangomaster1

  • 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

  • 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 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.