Jump to content

GeorgeHunter

Members
  • Posts

    4
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

GeorgeHunter's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I wanted to know, how Forge is doing that in detail, not how to use convenient Forge methods to do so.
  2. Uhm... do you actually understand what a stacktrace is and what I have written in my post before? Your posted part of the method AttackWithCompressedToolEvent.onAttack(...) ends at line => 43 <= BUT!!!: The java.lang.ArrayIndexOutOfBoundsException is thrown at line => 72 <= Do you know what I mean? Can you please post the whole method??? not only this part: ItemStack i = item.getSword(); System.out.println("collection: " + i.getItem().getAttributeModifiers(i).get(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName())); System.out.println("array of attributes: " + i.getItem().getAttributeModifiers(i).get(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()).toArray()); System.out.println("attribute: " + i.getItem().getAttributeModifiers(i).get(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()).toArray()[0]); Object[] array = i.getItem().getAttributeModifiers(i).get(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()).toArray(); System.out.println("lenght of array: " + array.length); Object object = i.getItem().getAttributeModifiers(i).get(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()).toArray()[array.length-1]; System.out.println("is object attribute: " + (object instanceof AttributeModifier)); AttributeModifier attribute = (AttributeModifier) object; meta = attribute.getAmount() > damage ? 1 : meta; damage = attribute.getAmount() > damage ? attribute.getAmount() : damage;
  3. Well the Exceptions is thrown at code.elix_x.toolscompressor.events.AttackWithCompressedToolEvent.onAttack(AttackWithCompressedToolEvent.java:72) ~[AttackWithCompressedToolEvent.class:?] So at line 72 in the method AttackWithCompressedToolEvent.onAttack(...) This is your last output to the console: [12:31:30] [Client thread/INFO] [sTDOUT]: [code.elix_x.toolscompressor.events.AttackWithCompressedToolEvent:onAttack:40]: is object attribute: true At line 40... I would recommend you to post the whole method if you want help and advice in this case.
  4. Hi every1, My main question is: Do I have to do anything more than just adding the Entity to the map in EntityList.java and RenderManager.java? But let's start from the beginning: Lately I was wondering how Forge registers new Entities and the corresponding Renderers. I just want to understand some substantial Forge mechanics to improve my modding skills. So I tried to add a new custom Mob to Minecraft without using Forge. When I am adding a new Mob, which extends a more specific Entity Type like EntityZombie, I just needed to add it to the map in EntityList.java and everything was fine and simple. But here is my problem and my actual question: How do I add a new Mob with a custom Model and Renderer? In this case I have just copied the EntityVillager.java, ModelVillager.java and RenderVillager.java and called them EntityTrader.java, ModelTrader.java and RenderTrader.java. In RenderTrader.java I have changed the parts where it called the render methods with EntityVillager, ModelVillager etc... I was really careful and replaced everything, that needed to be replaced. Additionally I have added the new Entity and the corresponding Renderer to the map in RenderManager.java. For some reason the Entity is invisible, when I spawn it with an egg and as well as if I call World.spawnEntity...(...). I am just hearing the sounds of the Entity and if I am using methods to find Entities within a specified AxisAlignedBoundingBox it is listed in the returned list. Finally I decided to check if the methods of RenderTrader.java were called, but none of them were called. I don't understand why Minecraft doesn't even try to render it. Did I miss something? Do I have to do anything more than just adding the Entity to the map in EntityList.java and RenderManager.java? I really hope, you can help me with that issue. Big THX in advance! GH
×
×
  • Create New...

Important Information

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