Jump to content

FloxRoxX

Members
  • Posts

    12
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Personal Text
    Just getting started

FloxRoxX's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hello TGG, wow... i would never had looked in this class.... i found some time to try it out and it worked now the only thing is, if you are not in creative mode the arrow fires not straight. I think i will figure this one out soon why this happens but thanks so much helping me with this. I hope this will help also a lot of ppl out there if they want to make custom arrows! EDIT: Okay editing the EntityTracker works but if i try to extend with EntityArrow it wont work. The Arrow is directly hitting myself. Editing MC classes isnt that good so i will try on extending... but it does not work.
  2. Hello TheGreyGhost, thanks in advance for helping me I zipped my whole forge folder with the project inside. Here is the download link for this:http://abetterworld.de/files/minecraftforge-src-TGG.zip It includes my testing world + some blocks + the bow and arrow + a bowrenderer for 3rd person I made an extra Creative tab for the items so you dont have to search ingame The bowrenderer can be disabled in the clientproxy in case you want to test without that(that one is also a bit buggy in multiplayer but renders just fine at singleplayer) If something is missing just tell me
  3. Yep i have my vanilla bow always in the inventory to feel unhappy why the original one is working Else i found something very interesting. If i change this line at my WoodenBow.class i get 2 arrows shoot, one correct and on is in the air. (The one that is correctly placed cannot be picked up) if (!par2World.isRemote) { par2World.spawnEntityInWorld(entityarrow); } changed to //if (!par2World.isRemote) //{ par2World.spawnEntityInWorld(entityarrow); //}
  4. OK i just have played around with the code a bit and put in about 40 debug points into the Entity class. The result was that i made no progess... I could not find any clue on the behaviour from the arrows fading back into air. Also i searched the forum for about an hour about arrow entities and i found many opened threads with about the same problem but no solutions. Isn't here in this forum anyone that had the same problem and a solution for this ? Does anyone knows a mod with custom arrows that is open source ? Maybe finding the solution while scrolling above their mods....
  5. Hello TheGreyGhost, Iam currently at work i will try and error this today evening . Very interesting for that iam just copied original classes
  6. Oh thanks i forgot to remove that while testing Iam still trying to figure out whats causing all this...
  7. Allright, i have tested some stuff and think the best is to put the code up here because i dont know where the problem is. What i also noticed is, that if the arrows float in the air its only graphically. I can grab them up at the wall if i go there and also if i wait some time they will be moved back in the wall where i have shoot them but this needs about 20 seconds. Here is the code: Main class: ClientProxy: RenderWoodArrow Class: EntityWoodArrow Class: WoodenBow Class: And last but not least... woodarrow class It is all original code so far BUT i had to change a little single thing: At the EntityWoodArrow class i had to change DamageSource.causeArrowDamage to DamageSource.causeThrownDamage because all i tried it would not work other ways... it could be, that this is maybe the mayor problem on this thing.... iam still confused....
  8. Hi all, iam working on a custom bow with an custom arrow with rendering and so on. So as far as iam i have everything working but as i shoot my arrow and it hits a block it will move about 2 blocks back from its destination. So for better explanation i have a screenshot for this: As you can see the arrows are floating in the air after they have hit the grey block at the wall... For making the Bow and arrow i copied the classes from: net.minecraft.entity.projectile.EntityArrow.java net.minecraft.item.ItemBow.java net.minecraft.client.renderer.entity.RenderArrow.java and made my own classes out of it. So now iam a little bit confused about that because that are all original classes... Anyone knows this behaviour or knows a fix for this ? EDIT: The problem must have something to do with the arrow speed. If i charge the bow with full thrust the arrow will flip back more as if i charge it only a little....
  9. I tried that already damaging the item one more time after setdamage 0 => same as before, it flips back to an empty damage bar... No it doesnt... it will start where it has stopped after right klick release... Removing the @Override also doesnt seem to work.... I found a solution to this but its not a very good way i think because i update the item everytime it is not clicked! maybe you have a look at this: public class testitem extends Item { public testitem(int id) { super(id); setMaxStackSize(1); setCreativeTab(itemmod.ItemMod); setTextureName("itemmod:testitem"); setMaxDamage(100); setHasSubtypes(true); } public boolean inuse = false; int damage = 20; @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { inuse = true; if(itemstack.getItemDamage() < itemstack.getMaxDamage()) { itemstack.setItemDamage(itemstack.getItemDamage() + damage); } player.setItemInUse(itemstack, itemstack.getMaxDamage()); if(player.isUsingItem()) { } else { player.setItemInUse(itemstack, itemstack.getMaxDamage()); } return itemstack; } @Override public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityPlayer player, int par4) { inuse = false; if(itemstack.getItemDamage() == itemstack.getMaxDamage()) { player.addChatMessage("Abracadabra alakazam!"); //Code for something that should happen here ^^ } else { player.addChatMessage("The spell fizzled..."); } } public void onUpdate(ItemStack itemstack, World world, Entity player, int par4, boolean par5) { if(inuse == false) { itemstack.setItemDamage(0); } } } Sometimetimes you stop klicking in the middle it just stops and does not go back to start... If anyone got a better solution for this i appreaciate it!
  10. Hi TheGreyGhost, thanks for the answer! I added some lines before and after the action: System.out.println("Item damage before reset: " + itemstack.getItemDamage()); itemstack.setItemDamage(0); System.out.println("Item damage after reset: " + itemstack.getItemDamage()); player.addChatMessage("Nothing happened!"); The result shows that the damage will be reset to 0 but the item damage bar at the item itself will stay at the position it was before -> see the screenshot: http://prntscr.com/251n9w
  11. Help is still appreciated! I tried some stuff out also with the bow class but i did not get it to work.... Does anyone have an idea ?
  12. Hi all, i try to make a skill based on a custom item. So far i got the item damaging itself on holding the right mouse button. But after releasing the button my item is not willing to reset the damage... Here is my code so far: public class testitem extends Item { public testitem(int id) { super(id); setMaxStackSize(1); setCreativeTab(itemmod.ItemMod); setTextureName("itemmod:testitem"); this.setMaxDamage(20); setHasSubtypes(true); } @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { if(itemstack.getItemDamage() < itemstack.getMaxDamage()) { itemstack.damageItem(2, player); } if(player.isUsingItem()) { } else { player.setItemInUse(itemstack, itemstack.getMaxDamage()); } return itemstack; } @Override public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityPlayer player, int par4) { if(itemstack.getItemDamage() == itemstack.getMaxDamage()) { itemstack.setItemDamage(0); player.addChatMessage("Do something magical... pressed it long enought!"); //Code for something that should happen here ^^ } else { itemstack.setItemDamage(0); } } }
×
×
  • Create New...

Important Information

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