Posted November 2, 201311 yr I was hoping that someone might be able to help me, I would like to change the texture of my block on right-click, to the texture of the block that the player right-clicked with, and I have no idea how to do it. Any help is greatly appreciated! PS. I do not want to change the block itself, just the texture! Dylan Gore
November 2, 201311 yr Author Would you be able to provide a bit more information, I have the tile entity bit but I have no experience with packets and I could not get the onBlockActivated() code to work Dylan Gore
November 7, 201311 yr This should work in theory but you do do something like this. Then you could do the void setTexure() from another class. public class ChangingBlock extends Block { private string Texture = "mod:default"; public void setTexture(string str1) { Texture = str1; } public ChangingBlock(int id, Material material) { super(id, material); setTextureName(Texture); } }
November 7, 201311 yr I don't think that is going to work, as the texture name is only being used at the initialization of the mod, when the IconRegister goes over all the registered blocks. Changing this String on the way doesn't have any effect. Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.
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.