Jump to content

[1.15.2]How to make a blockstate for changing texture of block


Recommended Posts

Posted

I want to make it so that when I right-click on a block, it changes the texture of the block. There will be more than two textures that will be cycled through and I want to know how to make a blockstate for something like this. Or if there's an existing one that works for this or something it would be a big help.

Posted

Have you tried looking at vanilla blocks that have similar behaviour? For example the redstone lamp, that change its texture based on its state (lit = false/true), or the respawn anchor (1.16) that has 5 possible different states depending on its charge. Keep in mind that the number of states a block can assume is limited. For anything that could exceed that limit you will need a tile entity.

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted
4 minutes ago, diesieben07 said:

Look at how vanilla makes block states use different models, (e.g. look at FenceBlock).

I dont want the blockstate to be dependent on direction.

4 minutes ago, Beethoven92 said:

Have you tried looking at vanilla blocks that have similar behaviour? For example the redstone lamp, that change its texture based on its state (lit = false/true), or the respawn anchor (1.16) that has 5 possible different states depending on its charge. Keep in mind that the number of states a block can assume is limited. For anything that could exceed that limit you will need a tile entity.

Yeah I think NOTE_0_24 which is for the different note pitches is most like what im trying to do. It has multiple states that cycle. I just dont know how it affects the note color and I think that would be what I need.

Posted
7 minutes ago, diesieben07 said:

The note color here has nothing to do with the block model.

You need a different model per block state, which is exactly what the fence does.

Ok I know I need a different model but I don't understand why the fence would be a good reference. It does change the model but I dont think the directional boolean properties help since all my block would do is depend on if the player right-clicked.

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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