Jump to content

gyro42

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by gyro42

  1. extending ItemAxe is the one that caused me to crash in the first place. I tried the constructor both with and without the floats, and attempted to deal with the damage and attack speed in a couple different ways. No Dice. If i could understand the error outputs correctly it was handling the attack damage that caused me to crash, but im not 100% on that. My solution was the convoluted mess that mimics the ItemAxe class. At least its working now.... isn't setHarvestLevel for the pickaxe types?
  2. It was another case of rereading my code after posting it and catching the error. bonus points to the first one to find it
  3. I am having issues getting my custom axe to show up in game, but no problems getting the other tools working. I tried a youtube video but it wasnt much help. Basically im unsure whether to have my class extend ItemTool or ItemAxe and how to set it up. Heres my code for the class. When the game loads the axe just doesnt appear and im not noticing any error messages in my console output. If i try the commented out bit instead, it just crashes. public class ToolAxe extends ItemTool implements IHasModel{ public static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(Blocks.PLANKS, Blocks.BOOKSHELF, Blocks.LOG, Blocks.LOG2, Blocks.CHEST, Blocks.PUMPKIN, Blocks.LIT_PUMPKIN, Blocks.MELON_BLOCK, Blocks.WOODEN_BUTTON, Blocks.LADDER, Blocks.WOODEN_PRESSURE_PLATE); public ToolAxe(String name, ToolMaterial material) { super(material, EFFECTIVE_ON); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.TOOLS); } public float getDestroySpeed(ItemStack stack, IBlockState state){ Material material = state.getMaterial(); return material != Material.WOOD && material != Material.PLANTS && material != Material.VINE ? super.getDestroySpeed(stack, state) : this.efficiency; } //public class ToolAxe extends ItemAxe implements IHasModel{ //public ToolAxe(String name, ToolMaterial material, float damage, float speed) { // super(material); // setUnlocalizedName(name); // setRegistryName(name); // attackDamage = damage; // attackSpeed = speed; // setCreativeTab(CreativeTabs.TOOLS); // ModItems.ITEMS.add(this); //}
  4. Well ive gotten it working now. The output tags helped alot. I was trying to handle BlockEvent.HarvestDropsEvent on grass. I was using Blocks.grass which it turns out, isnt actually grass. I found this out when i accidently mined the dirt in front of one while i was testing with the tags. I did read through your walkthrough and found it pretty informative. thanks again for being so helpful
  5. for now i will take your advice use a bunch of console statements and see how my handler is working in the game. To be honest im not really sure if it has been registered properly in init. I will go ahead and check out your tutorial too. thank you. my original question is still unanswered though. I dont know anything to use in an event or otherwise that is immediately apparent in the game.
  6. right now im trying to get into a vanilla block harvest event. I am trying to add my mod item to the drop list, and failing at it anyways i just want some kind of method that will fire for me when my if statements arent all true that shows in game somehow (damage player, add an effect on block destruction, something)
  7. Hi guys, im new to the whole modding scene and im trying to figure out the best methods for testing my event handler. Im looking for a simple method that will be obvious to me while i test in game. thanks
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.