Jump to content

suyama

Members
  • Posts

    2
  • Joined

  • Last visited

suyama's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. thanks guys. this was a nice push for me. and jabelar your blog is awesome. The Documention of forge is nice but im looking for something like this https://docs.oracle.com/javase/7/docs/api/ public void BlockHarvested(BlockEvent.BreakEvent event) { if (event.getState().getBlock().isWood(event.getWorld(), event.getPos())) { System.out.println("It Works!"); } } this is my event. it works fine now. Now I just need a method to delete everything around the harvested block. Could someone correct me if i have the wrong idea. I was thinking about a method which has 2 or 3 for loops (for x,y and perhaps z) with a max_radius of maybe 4 which has 2 conditions . if leaves || if wood -> break. block. And around the for loops i need my condition isAxe. If im correct I just need to find out how the Syntax works to do something like this
  2. Im trying to improve my java skills with modding some minecraft and currently im trying to do something like a chopping Tree mod. Im using tutorials and the MinecraftForge Docu but I still have trouble. I wanted to go like this. an event triggered through players destroying a block 2 conditions: active item == axe and destroyed block == wood conditions == true -> destroy tree Could somebody give me a little push or perhaps a tutorial about this problem. most tutorials i find are about creating items ^^ this is my method i was trying to get active item. public static boolean isItemAxe(EntityPlayer theplayer){ if(theplayer.getActiveItemStack().isEmpty()== true){ return false; } else if(theplayer.getActiveItemStack().isItemEqual(Items.IRON_PICKAXE)== false){ return false; } return true; Exception: The method isItemEqual(ItemStack) in the type ItemStack is not applicable for the arguments (Item) edit:// public static boolean isItemAxe(EntityPlayer theplayer){ if(theplayer == null || theplayer.getActiveItemStack().getItem() == null ){ return false; } else if(theplayer.getActiveItemStack().getItem() == Items.IRON_PICKAXE){ return true; }else return false; } this should work. later i try to do a condition with all pickaxes. Now im having trouble creating an event triggered through players destroying a block thanks in advance
×
×
  • Create New...

Important Information

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