CriscoMods Posted November 13, 2020 Posted November 13, 2020 (edited) I'm trying to create my own custom tool class. I'm trying to avoid Registering objects as a pickaxe item, because I want to use the effective_on feature to be able to create a pickaxe that breaks dirt, cobblestone, wood, etc.. So I created my own class, Sledge Hammer, that extends ToolItem Then I create my tool Item by registering it as a new Instance of the class I just created. \ I pass an IItemTier, SLEDGE_HAMMER, which has a harvest level of 3. When I test this, the item shows up as it should, but when I break blocks with a harvest level of 2 or greater I do not receive the drop. I do receive the drop for blocks with harvest level 1. It does all this despite the IItemTier being defined with a harvest level of 3. Obviously I'm doing something wrong and I don't know what at this point. If anyone can point in me in the right direction that would be great. *What's even weirder is that the attackDamage and maxUses works as I defined it. Edited November 13, 2020 by CriscoMods Quote
CriscoMods Posted November 13, 2020 Author Posted November 13, 2020 FIGURED IT OUT Apparently you have to override the canHarvestBlock function and have it return true. After doing this I was able to harvest the blocks I was breaking. Quote
Draco18s Posted November 13, 2020 Posted November 13, 2020 Why are you posting text as images? Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
CriscoMods Posted November 13, 2020 Author Posted November 13, 2020 On 11/13/2020 at 3:51 PM, Draco18s said: Why are you posting text as images? Expand new to the site. Posting the image as text was easier to me. I see the full image on my side. Do you not see it as an image? Also do you know what Illegal forge reposting is? I accidentally shared a link to a site doing it on here and had no idea it was bad. Quote
Draco18s Posted November 13, 2020 Posted November 13, 2020 It's text.... The forum supports text, you can just copy and paste. You want code formatting, click the <> button. If there was an issue with your code and I wanted to fix it, I'd have to completely retype your code if you post an image. You post text I can edit it. 1 Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
CriscoMods Posted November 14, 2020 Author Posted November 14, 2020 On 11/13/2020 at 8:12 PM, Draco18s said: It's text.... The forum supports text, you can just copy and paste. You want code formatting, click the <> button. If there was an issue with your code and I wanted to fix it, I'd have to completely retype your code if you post an image. You post text I can edit it. Expand oh... makes a bunch of sense. I'll do better next time I post thanks Quote
Recommended Posts
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.