Posted June 21, 201411 yr 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
June 21, 201411 yr 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.
June 21, 201411 yr 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/
June 21, 201411 yr 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.
June 21, 201411 yr Author ok ive copied some stuff from the wool class but the icon textures work but if i place them down they are all white block class http://pastebin.com/jULXQ2n4 main class http://pastebin.com/w71waU0e
June 21, 201411 yr 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/
June 21, 201411 yr 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
June 21, 201411 yr 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
June 21, 201411 yr 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
June 21, 201411 yr 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.
June 21, 201411 yr 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.
June 22, 201411 yr 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)
July 18, 201411 yr 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
July 18, 201411 yr Author Look at onBlockActivated and this DO NOT COPY CODE thats the best example u can get thanks
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.