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 want to make a block that when you right click it with a dye it changes to that color

 

any idea how to do that

 

 

thanks

The easiest method to archive it would be to create 16 sub blocks using metadata such as the wool Blocks and use onBlockActivated to change that metadata when you use a dye on the Block. You just have to create 16 different Textures for every color.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Ore you could use a custom block renderer so you don't need to make 16 different textures.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

I just thought that it would be overly complicated to create a renderer but it would make it easier to implement more colors.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

You literally copy-pasted that code from the BlockWool class. I be you don't even understand a quarter of it. Most of the things you don't even need.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author

You literally copy-pasted that code from the BlockWool class. I be you don't even understand a quarter of it. Most of the things you don't even need.

 

yes ist true i dont know very much about it but i just want to know how to do it

Hey, I'm pretty new to Java and modding, but I think you can't make a block with changing Textures, (I tried that and its changing the textures for EVREY block, not only the one you clicked (but I'm probably just doing sth. wrong ^^)) so, however, I think it's a lot smarter to just make diffrent Blocks for every colour, wool and the furnace do the same thing too, then just check in the onBlockActivated() method, what the block was clicked with (I'm not too sure how you do that) and set a new Block with the right colour to the old position...

hope that wasn't confusing and i could help :)

  • Author

Hey, I'm pretty new to Java and modding, but I think you can't make a block with changing Textures, (I tried that and its changing the textures for EVREY block, not only the one you clicked (but I'm probably just doing sth. wrong ^^)) so, however, I think it's a lot smarter to just make diffrent Blocks for every colour, wool and the furnace do the same thing too, then just check in the onBlockActivated() method, what the block was clicked with (I'm not too sure how you do that) and set a new Block with the right colour to the old position...

hope that wasn't confusing and i could help :)

well what you just said i was already doing so. but still thanks for trying to help

 

Personally I'd make a block with the onRightClickedMethod() then in that method I would put a switch statement testing for each dye (by ore dictionary) and then if it is x dye it changes to x color.

 

This would need to be a tile entity though.

Everyone is repeating themselves >.>

 

And a metadata block is the best way to go... Unless of course your block has special functionality depending on the color?

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Everyone is repeating themselves >.>

 

And a metadata block is the best way to go... Unless of course your block has special functionality depending on the color?

@Kwibble just repeating this in case he doesn't understand (you obviously understand)

 

and if it had a special functionality you'd have to make separate blocks (at you level of knowledge)

  • 4 weeks later...
  • Author

ok i have made the subblocks and got the textures working but i couldnt figure out how to change the block depending on the dye anyone got a example or something?

 

thanks in advance

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.