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

Basically I'm making a chessboard. On it, you have each of the pieces which you can move independently of each other. The chessboard only takes up one block of space. Obviously I CANNOT make a blockstate for each playable position on a chessboard. What kind of system do I use then? I'd like to have each space on a chessboard essentially have it's own blockstate so that they behave as if they are each their own block. Or maybe there's a way to combine block states? Of course the effect I'm trying to achieve can be done but how should the underlying functionality accomplish this?

If you have too many BlockStates you can render the Block by yourself using a BlockEntityRenderer.

I have never done this myself, but you could look at the vanilla chest as an example of how a block/model is rendered.
But I can't promise you that this is the right direction to do this.

  • Author

Okay, yeah that solves needing a ton of block states. I suppose I could just use some block properties to describe what pieces are where and then just render the chessboard based on those properties. Awesome! Still, how might I make the pieces placeable? Here's my idea (tell me if it's dumb). If the player is holding a piece and right clicks the chessboard, a raycast is preformed which is used to determine what chess piece or space the player is actually clicking. Then I can set the chessboard properties accordingly and and render it. Good idea, or is there a more simple approach?

On 10/31/2023 at 2:55 AM, Baybird said:

I suppose I could just use some block properties to describe what pieces are where and then just render the chessboard based on those properties.

Note, you need to store those block properties per block which means it requires a BlockEntity

 

On 10/31/2023 at 2:55 AM, Baybird said:

If the player is holding a piece and right clicks the chessboard, a raycast is preformed which is used to determine what chess piece or space the player is actually clicking.

Minecraft provides no other way to do this. You can take a look at the ChiseledBookShelfBlock for an vanilla example how to clip/raycast a position on a Block.

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.