Posted October 28, 20231 yr 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?
October 29, 20231 yr 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.
October 31, 20231 yr 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?
November 1, 20231 yr 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.