Posted June 29, 201510 yr Hi, I created a partial block, and during the process of modifying "onItemUse()" I noticed it is only executed when the block "isReplaceable". At least in this case: My block is obviously the small dirt block. Now, when I right-click where I'm looking at on that picture, while my block isReplaceable, the method onItemUse is called, and I can modify the TileEntity on that position. Which is what I want to do. But, I don't want my block to be replaceable by other blocks! But when I set isReplaceable to false, the method isn't called anymore, and I don't understand that, since the method itself checks if the block can be placed, why is there another check, even before, and where is it, so I can change it? Thanks in advance Reygok My first Mod: http://www.curse.com/mc-mods/minecraft/231302-adamantium-mod-better-than-diamonds#
June 29, 201510 yr Who told that? Going through onItemUse call hierarchy and i haven't found where it is blocked... Can you specify then where it is blocked by isReplaceable? Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
June 29, 201510 yr Author Well, I put "System.out.println("start onItemUse");" at the very beginning of the method, and this line is not printed. When I set my block to replaceable, it is. So perhaps the problem lies somewhere else? Should I provide my entire code? My first Mod: http://www.curse.com/mc-mods/minecraft/231302-adamantium-mod-better-than-diamonds#
June 29, 201510 yr Well, I put "System.out.println("start onItemUse");" at the very beginning of the method, and this line is not printed. When I set my block to replaceable, it is. So perhaps the problem lies somewhere else? Should I provide my entire code? Probably yes. Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
June 29, 201510 yr Author Here are the two concerning classes, my block: http://pastebin.com/q6g3wy6M and my item: http://pastebin.com/XA6BDsRU My first Mod: http://www.curse.com/mc-mods/minecraft/231302-adamantium-mod-better-than-diamonds#
June 30, 201510 yr Here are the two concerning classes, my block: http://pastebin.com/q6g3wy6M and my item: http://pastebin.com/XA6BDsRU Are you sure that you want to extend ItemBlock? This my not be the best idea... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
June 30, 201510 yr Author Well, I have that idea from diesieben07, who seems quite good at modding. I absolutely need to have the exact spot where the player clocks on a block, I don't see how else I could do that. My first Mod: http://www.curse.com/mc-mods/minecraft/231302-adamantium-mod-better-than-diamonds#
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.