Jump to content

Lyras

Members
  • Posts

    41
  • Joined

  • Last visited

Everything posted by Lyras

  1. After a while I got time to go through my code and my items/weapons etc. I noticed that the blocking model isn't working and I want to get it to work! [normal shield] { "textures": { "0": "betterlife:items/shield_iron" }, "display": { "thirdperson_righthand": { "rotation": [ 90, -75, 90 ], "translation": [ 2, -2, 1 ], "scale": [ 1, 1, 1 ] }, "thirdperson_lefthand": { "rotation": [ 90, -75, 90 ], "translation": [ 2, -2, 1 ], "scale": [ 1, 1, 1 ] }, "firstperson_righthand": { "rotation": [ 10, -15, -3 ], "translation": [ 0, 0, 0 ], "scale": [ 0.9, 0.9, 0.9 ] }, "firstperson_lefthand": { "rotation": [ 10, -15, -3 ], "translation": [ 0, 0, 0 ], "scale": [ 0.9, 0.9, 0.9 ] }, "gui": { "rotation": [ 0, 180, 0 ], "translation": [ 0, 0, 0 ], "scale": [ 1, 1, 1 ] } }, "overrides": [ { "predicate": { "betterlife:blocking": 1 }, "model": "betterlife:item/shield_iron_blocking" } ], "elements": [ { "name": "Border", "from": [ 7.0, 1.0, 7.0 ], "to": [ 9.0, 2.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 15.0 ] }, "east": { "texture": "#0", "uv": [ 7.0, 14.0, 8.0, 15.0 ] }, "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 15.0 ] }, "west": { "texture": "#0", "uv": [ 8.0, 14.0, 9.0, 15.0 ] }, "up": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 15.0 ] }, "down": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 15.0 ] } } }, { "name": "Border", "from": [ 5.0, 2.0, 7.0 ], "to": [ 7.0, 3.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 9.0, 13.0, 11.0, 14.0 ] }, "east": { "texture": "#0", "uv": [ 9.0, 13.0, 10.0, 14.0 ] }, "south": { "texture": "#0", "uv": [ 9.0, 13.0, 11.0, 14.0 ] }, "west": { "texture": "#0", "uv": [ 10.0, 13.0, 11.0, 14.0 ] }, "up": { "texture": "#0", "uv": [ 9.0, 13.0, 11.0, 14.0 ] }, "down": { "texture": "#0", "uv": [ 9.0, 13.0, 11.0, 14.0 ] } } }, { "name": "Border", "from": [ 9.0, 2.0, 7.0 ], "to": [ 11.0, 3.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 13.0, 7.0, 14.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 13.0, 6.0, 14.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 13.0, 7.0, 14.0 ] }, "west": { "texture": "#0", "uv": [ 6.0, 13.0, 7.0, 14.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 13.0, 7.0, 14.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 13.0, 7.0, 14.0 ] } } }, { "name": "Border", "from": [ 4.0, 3.0, 7.0 ], "to": [ 5.0, 4.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] } } }, { "name": "Border", "from": [ 11.0, 3.0, 7.0 ], "to": [ 12.0, 4.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] } } }, { "name": "Border", "from": [ 3.0, 4.0, 7.0 ], "to": [ 4.0, 7.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 12.0, 9.0, 13.0, 12.0 ] }, "east": { "texture": "#0", "uv": [ 12.0, 9.0, 13.0, 12.0 ] }, "south": { "texture": "#0", "uv": [ 12.0, 9.0, 13.0, 12.0 ] }, "west": { "texture": "#0", "uv": [ 12.0, 9.0, 13.0, 12.0 ] }, "up": { "texture": "#0", "uv": [ 13.0, 9.0, 12.0, 10.0 ] }, "down": { "texture": "#0", "uv": [ 12.0, 11.0, 13.0, 12.0 ] } } }, { "name": "Border", "from": [ 12.0, 4.0, 7.0 ], "to": [ 13.0, 7.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 12.0 ] }, "east": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 12.0 ] }, "south": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 12.0 ] }, "west": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 12.0 ] }, "up": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 10.0 ] }, "down": { "texture": "#0", "uv": [ 3.0, 11.0, 4.0, 12.0 ] } } }, { "name": "Border", "from": [ 2.0, 7.0, 7.0 ], "to": [ 3.0, 10.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 9.0 ] }, "east": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 9.0 ] }, "south": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 9.0 ] }, "west": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 9.0 ] }, "up": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 7.0 ] }, "down": { "texture": "#0", "uv": [ 13.0, 8.0, 14.0, 9.0 ] } } }, { "name": "Border", "from": [ 13.0, 7.0, 7.0 ], "to": [ 14.0, 10.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 9.0 ] }, "east": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 9.0 ] }, "south": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 9.0 ] }, "west": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 9.0 ] }, "up": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 7.0 ] }, "down": { "texture": "#0", "uv": [ 2.0, 8.0, 3.0, 9.0 ] } } }, { "name": "Border", "from": [ 1.0, 10.0, 7.0 ], "to": [ 2.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 6.0 ] }, "east": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 6.0 ] }, "south": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 6.0 ] }, "west": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 6.0 ] }, "up": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 14.0, 5.0, 15.0, 6.0 ] } } }, { "name": "Border", "from": [ 14.0, 10.0, 7.0 ], "to": [ 15.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 6.0 ] }, "east": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 6.0 ] }, "south": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 6.0 ] }, "west": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 6.0 ] }, "up": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 5.0 ] } } }, { "name": "Border", "from": [ 2.0, 12.0, 7.0 ], "to": [ 4.0, 13.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 4.0 ] }, "east": { "texture": "#0", "uv": [ 12.0, 3.0, 13.0, 4.0 ] }, "south": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 4.0 ] }, "west": { "texture": "#0", "uv": [ 13.0, 3.0, 14.0, 4.0 ] }, "up": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 4.0 ] }, "down": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 4.0 ] } } }, { "name": "Border", "from": [ 12.0, 12.0, 7.0 ], "to": [ 14.0, 13.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 2.0, 3.0, 4.0, 4.0 ] }, "east": { "texture": "#0", "uv": [ 2.0, 3.0, 3.0, 4.0 ] }, "south": { "texture": "#0", "uv": [ 2.0, 3.0, 4.0, 4.0 ] }, "west": { "texture": "#0", "uv": [ 3.0, 3.0, 4.0, 4.0 ] }, "up": { "texture": "#0", "uv": [ 2.0, 3.0, 4.0, 4.0 ] }, "down": { "texture": "#0", "uv": [ 2.0, 3.0, 4.0, 4.0 ] } } }, { "name": "Border", "from": [ 4.0, 13.0, 7.0 ], "to": [ 7.0, 14.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 9.0, 2.0, 12.0, 3.0 ] }, "east": { "texture": "#0", "uv": [ 9.0, 2.0, 10.0, 3.0 ] }, "south": { "texture": "#0", "uv": [ 9.0, 2.0, 12.0, 3.0 ] }, "west": { "texture": "#0", "uv": [ 11.0, 2.0, 12.0, 3.0 ] }, "up": { "texture": "#0", "uv": [ 9.0, 2.0, 12.0, 3.0 ] }, "down": { "texture": "#0", "uv": [ 9.0, 2.0, 12.0, 3.0 ] } } }, { "name": "Border", "from": [ 9.0, 13.0, 7.0 ], "to": [ 12.0, 14.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 4.0, 2.0, 7.0, 3.0 ] }, "east": { "texture": "#0", "uv": [ 4.0, 2.0, 5.0, 3.0 ] }, "south": { "texture": "#0", "uv": [ 4.0, 2.0, 7.0, 3.0 ] }, "west": { "texture": "#0", "uv": [ 6.0, 2.0, 7.0, 3.0 ] }, "up": { "texture": "#0", "uv": [ 4.0, 2.0, 7.0, 3.0 ] }, "down": { "texture": "#0", "uv": [ 4.0, 2.0, 7.0, 3.0 ] } } }, { "name": "Border", "from": [ 7.0, 14.0, 7.0 ], "to": [ 9.0, 15.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 7.0, 1.0, 9.0, 2.0 ] }, "east": { "texture": "#0", "uv": [ 7.0, 1.0, 8.0, 2.0 ] }, "south": { "texture": "#0", "uv": [ 7.0, 1.0, 9.0, 2.0 ] }, "west": { "texture": "#0", "uv": [ 8.0, 1.0, 9.0, 2.0 ] }, "up": { "texture": "#0", "uv": [ 7.0, 1.0, 9.0, 2.0 ] }, "down": { "texture": "#0", "uv": [ 7.0, 1.0, 9.0, 2.0 ] } } }, { "name": "Inside", "from": [ 4.0, 4.0, 7.0 ], "to": [ 12.0, 13.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 4.0, 3.0, 12.0, 12.0 ] }, "east": { "texture": "#0", "uv": [ 4.0, 3.0, 5.0, 12.0 ] }, "south": { "texture": "#0", "uv": [ 4.0, 3.0, 12.0, 12.0 ] }, "west": { "texture": "#0", "uv": [ 11.0, 3.0, 12.0, 12.0 ] }, "up": { "texture": "#0", "uv": [ 4.0, 3.0, 12.0, 4.0 ] }, "down": { "texture": "#0", "uv": [ 4.0, 11.0, 12.0, 12.0 ] } } }, { "name": "Inside", "from": [ 5.0, 3.0, 7.0 ], "to": [ 11.0, 4.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 12.0, 11.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 12.0, 11.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 10.0, 12.0, 11.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 12.0, 11.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 12.0, 11.0, 13.0 ] } } }, { "name": "Inside", "from": [ 7.0, 2.0, 7.0 ], "to": [ 9.0, 3.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 7.0, 13.0, 9.0, 14.0 ] }, "east": { "texture": "#0", "uv": [ 7.0, 13.0, 8.0, 14.0 ] }, "south": { "texture": "#0", "uv": [ 7.0, 13.0, 9.0, 14.0 ] }, "west": { "texture": "#0", "uv": [ 8.0, 13.0, 9.0, 14.0 ] }, "up": { "texture": "#0", "uv": [ 7.0, 13.0, 9.0, 14.0 ] }, "down": { "texture": "#0", "uv": [ 7.0, 13.0, 9.0, 14.0 ] } } }, { "name": "Inside", "from": [ 7.0, 13.0, 7.0 ], "to": [ 9.0, 14.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 3.0 ] }, "east": { "texture": "#0", "uv": [ 7.0, 2.0, 8.0, 3.0 ] }, "south": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 3.0 ] }, "west": { "texture": "#0", "uv": [ 8.0, 2.0, 9.0, 3.0 ] }, "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 3.0 ] }, "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 3.0 ] } } }, { "name": "Inside", "from": [ 3.0, 7.0, 7.0 ], "to": [ 4.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 9.0 ] }, "east": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 9.0 ] }, "south": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 9.0 ] }, "west": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 9.0 ] }, "up": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 12.0, 8.0, 13.0, 9.0 ] } } }, { "name": "Inside", "from": [ 2.0, 10.0, 7.0 ], "to": [ 3.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 6.0 ] }, "east": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 6.0 ] }, "south": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 6.0 ] }, "west": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 6.0 ] }, "up": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 13.0, 5.0, 14.0, 6.0 ] } } }, { "name": "Inside", "from": [ 12.0, 7.0, 7.0 ], "to": [ 13.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 9.0 ] }, "east": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 9.0 ] }, "south": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 9.0 ] }, "west": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 9.0 ] }, "up": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 3.0, 8.0, 4.0, 9.0 ] } } }, { "name": "Inside", "from": [ 13.0, 10.0, 7.0 ], "to": [ 14.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 6.0 ] }, "east": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 6.0 ] }, "south": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 6.0 ] }, "west": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 6.0 ] }, "up": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 2.0, 5.0, 3.0, 6.0 ] } } }, { "name": "Inside", "from": [ 9.0, 8.0, 8.0 ], "to": [ 10.0, 9.0, 9.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] } } }, { "name": "Inside", "from": [ 6.0, 8.0, 8.0 ], "to": [ 7.0, 9.0, 9.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] } } }, { "name": "Inside", "from": [ 6.0, 8.0, 9.0 ], "to": [ 10.0, 9.0, 10.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] } } } ] } [blocking] { "parent": "betterlife:item/shield_iron", "textures": { "layer0": "betterlife:items/shield_iron" }, "display": { "thirdperson_righthand": { "rotation": [ 90, -75, 90 ], "translation": [ 2, -2, 1 ], "scale": [ 1, 1, 1 ] }, "thirdperson_lefthand": { "rotation": [ 90, -75, 90 ], "translation": [ 2, -2, 1 ], "scale": [ 1, 1, 1 ] }, "firstperson_righthand": { "rotation": [ 20, 15, 60 ], "translation": [ 0, 0, 0 ], "scale": [ 0.9, 0.9, 0.9 ] }, "firstperson_lefthand": { "rotation": [ 10, -15, -3 ], "translation": [ 0, 0, 0 ], "scale": [ 0.9, 0.9, 0.9 ] } } } What am I doing wrong? Thanks in advance
  2. Lyras

    Custom Bow

    Chose wrong words. I just don't know which values I have to take or where I can find them. I already looked up in the API and different mods. Code: @Override public void onPlayerStoppedUsing ( ItemStack stack , World world , EntityLivingBase entity , int charge ) { if ( entity instanceof EntityPlayer ) { EntityPlayer player = ( EntityPlayer ) entity; boolean ammoRequired = this.isAmmoRequired( stack , player ); ItemStack ammo = this.findAmmo( player ); int duration = this.getMaxItemUseDuration( stack ) - charge; duration = net.minecraftforge.event.ForgeEventFactory.onArrowLoose( stack , world , ( EntityPlayer ) entity , duration , stack != null || ammoRequired ); if ( duration < 0 ) { return; } if ( stack != null || ammoRequired ) { if ( stack == null ) { stack = new ItemStack ( Items.arrow ); } float velocity = this.func_185059_b( duration ); if ( ( double ) velocity >= 0.1D ) { boolean unpickable = player.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel( Enchantments.infinity , stack ) > 0; if ( !world.isRemote ) { ItemArrow arrowItem = ( ItemArrow ) ( ( ItemArrow ) ( stack.getItem() instanceof ItemArrow ? stack.getItem() : Items.arrow ) ); EntityArrow arrow = arrowItem.makeTippedArrow( world , stack , player ); arrow.func_184547_a( player , player.rotationPitch , player.rotationYaw , 0.0F , velocity * 3.0F , 1.0F ); if ( velocity == 1.0F ) { arrow.setIsCritical( true ); } int levelPower = EnchantmentHelper.getEnchantmentLevel( Enchantments.power , stack ); if ( levelPower > 0 ) { arrow.setDamage( this.baseDamage + arrow.getDamage() + ( double ) levelPower * 0.5D + 0.5D ); } else { arrow.setDamage( this.baseDamage + arrow.getDamage() + 0.5D ); System.out.println( this.baseDamage + arrow.getDamage() + 0.5D ); } int levelPunch = EnchantmentHelper.getEnchantmentLevel( Enchantments.punch , stack ); if ( levelPunch > 0 ) { arrow.setKnockbackStrength( levelPunch ); } if ( EnchantmentHelper.getEnchantmentLevel( Enchantments.flame , stack ) > 0 ) { arrow.setFire( 100 ); } stack.damageItem( 1 , player ); if ( unpickable ) { arrow.canBePickedUp = EntityArrow.PickupStatus.CREATIVE_ONLY; } world.spawnEntityInWorld( arrow ); } world.playSound( ( EntityPlayer ) null , player.posX , player.posY , player.posZ , SoundEvents.entity_arrow_shoot , SoundCategory.NEUTRAL , 1.0F , 1.0F / ( itemRand.nextFloat() * 0.4F + 1.2F ) + velocity * 0.5F ); if ( !unpickable && !player.capabilities.isCreativeMode ) { --ammo.stackSize; if ( ammo .stackSize == 0 ) { player.inventory.deleteStack( ammo ); } } player.addStat( StatList.func_188057_b( this ) ); } } } }
  3. Lyras

    Custom Bow

    That was my fault. I fixed it but it didn't help me. This is my problem in a collage: I already done that. I looked at your code for your [glow=red,2,300]TestBow[/glow] and at ItemBow#onPlayerStoppedUsing but I don't know my mistake D: EDIT: Fixed it. But when the shot arrow was something like an "Arrow Of Leaping" it will get turned into a normal arrow and I don't know how to change the FOV properly. I want it to change it like with the normal bow
  4. Lyras

    Custom Bow

    But the pickup-status is PickupStatus#CREATIVE_ONLY @Override public void onPlayerStoppedUsing ( ItemStack stack , World world , EntityLivingBase entity , int charge ) { if ( entity instanceof EntityPlayer ) { EntityPlayer player = ( EntityPlayer ) entity; boolean ammoRequired = this.isAmmoRequired( stack , player ); ItemStack ammo = this.getAmmo( player ); int duration = this.getMaxItemUseDuration( stack ) - charge; duration = ForgeEventFactory.onArrowLoose( stack , world , ( EntityPlayer ) entity , duration , stack != null || ammoRequired ); if ( duration < 0 ) { return; } if ( stack != null || ammoRequired ) { if ( stack == null ) { stack = new ItemStack ( Items.arrow ); } float velocity = this.func_185059_b( duration ); if ( ( double ) velocity >= 0.1D ) { boolean unpickable = ammoRequired && stack.getItem() instanceof ItemArrow; //Forge: Fix consuming custom arrows. if ( !world.isRemote ) { ItemArrow arrowItem = ( ItemArrow ) ( ( ItemArrow ) ( stack.getItem() instanceof ItemArrow ? stack.getItem() : Items.arrow ) ); EntityArrow arrow = arrowItem.makeTippedArrow( world , stack, player ); arrow.func_184547_a( player , player.rotationPitch , player.rotationYaw , 0.0F , velocity * 3.0F , 1.0F ); if ( velocity == 1.0F ) { arrow.setIsCritical( true ); } int levelPower = EnchantmentHelper.getEnchantmentLevel(Enchantments.power, stack); if ( levelPower > 0 ) { arrow.setDamage( this.baseDamage + arrow.getDamage() + ( double ) levelPower * 0.5D + 0.5D ); System.out.println( this.baseDamage + arrow.getDamage() + ( double ) levelPower * 0.5D + 0.5D ); } else { arrow.setDamage( this.baseDamage + arrow.getDamage() + 0.5D ); System.out.println( this.baseDamage + arrow.getDamage() + 0.5D ); } int levelPunch = EnchantmentHelper.getEnchantmentLevel(Enchantments.punch, stack); if ( levelPunch > 0 ) { arrow.setKnockbackStrength( levelPunch ); } if ( EnchantmentHelper.getEnchantmentLevel( Enchantments.flame , stack ) > 0 ) { arrow.setFire( 100 ); } stack.damageItem( 1 , player ); if ( unpickable ) { arrow.canBePickedUp = EntityArrow.PickupStatus.CREATIVE_ONLY; } world.spawnEntityInWorld( arrow ); } world.playSound( ( EntityPlayer ) null , player.posX , player.posY , player.posZ , SoundEvents.entity_arrow_shoot , SoundCategory.NEUTRAL , 1.0F , 1.0F / ( itemRand.nextFloat() * 0.4F + 1.2F ) + velocity * 0.5F ); if ( !unpickable && !player.capabilities.isCreativeMode ) { --ammo.stackSize; if ( ammo .stackSize == 0 ) { player.inventory.deleteStack( ammo ); } } player.addStat( StatList.func_188057_b( this ) ); } } } }
  5. Lyras

    Custom Bow

    - I know but the arrow gets collected by the player and gets actually added to the inventory... [Example: You got an empty slot in your hotbar. When you collect an arrow from the ground which got shot with my custom bow, you will habe an arrow in your horbar] With the normal bow you shot, collect the arrow and it won't be added to the inventory. [Example: The collected arrow won't be in your hotbar]
  6. Hey, It's me again As the title says, I am making a custom bow. With some help from some users I already made the bow work partially. 2 things don't work: - The bow does not get a zoom (I mean the zoom you get by pulling the normal bow) - When the player collects the arrow, an arrow will be added to the creative inventory Can you help me? Thanks in advance :'(
  7. Thank you so, so much! Without your help I never ever fixed it! <3 Thanks over 9000
  8. I am despairing. As you can see in this thread ( = http://www.minecraftforge.net/forum/index.php/topic,40447.0.html [by the way: unsolved] ) I've got a annoying problem I cannot solve. My first problem: I'm creating shields and of course I want some animation for blocking. And of course I made a model for this. Sadly this model won't work. The model for just holding is working perfectly but the "blocking"-model isn't working at all! Unfortunately Minecraft takes the standart "blocking"-model. [Holding Model] { "textures": { "0": "betterlife:items/shield_iron" }, "display": { "thirdperson_righthand": { "rotation": [ 90, -75, 90 ], "translation": [ 2, -2, 1 ], "scale": [ 1, 1, 1 ] }, "thirdperson_lefthand": { "rotation": [ 90, -75, 90 ], "translation": [ 2, -2, 1 ], "scale": [ 1, 1, 1 ] }, "firstperson_righthand": { "rotation": [ 10, -15, -3 ], "translation": [ 0, 0, 0 ], "scale": [ 0.9, 0.9, 0.9 ] }, "firstperson_lefthand": { "rotation": [ 10, -15, -3 ], "translation": [ 0, 0, 0 ], "scale": [ 0.9, 0.9, 0.9 ] }, "gui": { "rotation": [ 0, 180, 0 ], "translation": [ 0, 0, 0 ], "scale": [ 1, 1, 1 ] } }, "overrides": [ { "predicate": { "blocking": 1 }, "model": "betterlife:item/shield_iron_blocking" } ], "elements": [ { "name": "Border", "from": [ 7.0, 1.0, 7.0 ], "to": [ 9.0, 2.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 15.0 ] }, "east": { "texture": "#0", "uv": [ 7.0, 14.0, 8.0, 15.0 ] }, "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 15.0 ] }, "west": { "texture": "#0", "uv": [ 8.0, 14.0, 9.0, 15.0 ] }, "up": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 15.0 ] }, "down": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 15.0 ] } } }, { "name": "Border", "from": [ 5.0, 2.0, 7.0 ], "to": [ 7.0, 3.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 9.0, 13.0, 11.0, 14.0 ] }, "east": { "texture": "#0", "uv": [ 9.0, 13.0, 10.0, 14.0 ] }, "south": { "texture": "#0", "uv": [ 9.0, 13.0, 11.0, 14.0 ] }, "west": { "texture": "#0", "uv": [ 10.0, 13.0, 11.0, 14.0 ] }, "up": { "texture": "#0", "uv": [ 9.0, 13.0, 11.0, 14.0 ] }, "down": { "texture": "#0", "uv": [ 9.0, 13.0, 11.0, 14.0 ] } } }, { "name": "Border", "from": [ 9.0, 2.0, 7.0 ], "to": [ 11.0, 3.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 13.0, 7.0, 14.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 13.0, 6.0, 14.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 13.0, 7.0, 14.0 ] }, "west": { "texture": "#0", "uv": [ 6.0, 13.0, 7.0, 14.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 13.0, 7.0, 14.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 13.0, 7.0, 14.0 ] } } }, { "name": "Border", "from": [ 4.0, 3.0, 7.0 ], "to": [ 5.0, 4.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] } } }, { "name": "Border", "from": [ 11.0, 3.0, 7.0 ], "to": [ 12.0, 4.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] } } }, { "name": "Border", "from": [ 3.0, 4.0, 7.0 ], "to": [ 4.0, 7.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 12.0, 9.0, 13.0, 12.0 ] }, "east": { "texture": "#0", "uv": [ 12.0, 9.0, 13.0, 12.0 ] }, "south": { "texture": "#0", "uv": [ 12.0, 9.0, 13.0, 12.0 ] }, "west": { "texture": "#0", "uv": [ 12.0, 9.0, 13.0, 12.0 ] }, "up": { "texture": "#0", "uv": [ 13.0, 9.0, 12.0, 10.0 ] }, "down": { "texture": "#0", "uv": [ 12.0, 11.0, 13.0, 12.0 ] } } }, { "name": "Border", "from": [ 12.0, 4.0, 7.0 ], "to": [ 13.0, 7.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 12.0 ] }, "east": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 12.0 ] }, "south": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 12.0 ] }, "west": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 12.0 ] }, "up": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 10.0 ] }, "down": { "texture": "#0", "uv": [ 3.0, 11.0, 4.0, 12.0 ] } } }, { "name": "Border", "from": [ 2.0, 7.0, 7.0 ], "to": [ 3.0, 10.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 9.0 ] }, "east": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 9.0 ] }, "south": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 9.0 ] }, "west": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 9.0 ] }, "up": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 7.0 ] }, "down": { "texture": "#0", "uv": [ 13.0, 8.0, 14.0, 9.0 ] } } }, { "name": "Border", "from": [ 13.0, 7.0, 7.0 ], "to": [ 14.0, 10.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 9.0 ] }, "east": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 9.0 ] }, "south": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 9.0 ] }, "west": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 9.0 ] }, "up": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 7.0 ] }, "down": { "texture": "#0", "uv": [ 2.0, 8.0, 3.0, 9.0 ] } } }, { "name": "Border", "from": [ 1.0, 10.0, 7.0 ], "to": [ 2.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 6.0 ] }, "east": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 6.0 ] }, "south": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 6.0 ] }, "west": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 6.0 ] }, "up": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 14.0, 5.0, 15.0, 6.0 ] } } }, { "name": "Border", "from": [ 14.0, 10.0, 7.0 ], "to": [ 15.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 6.0 ] }, "east": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 6.0 ] }, "south": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 6.0 ] }, "west": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 6.0 ] }, "up": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 5.0 ] } } }, { "name": "Border", "from": [ 2.0, 12.0, 7.0 ], "to": [ 4.0, 13.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 4.0 ] }, "east": { "texture": "#0", "uv": [ 12.0, 3.0, 13.0, 4.0 ] }, "south": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 4.0 ] }, "west": { "texture": "#0", "uv": [ 13.0, 3.0, 14.0, 4.0 ] }, "up": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 4.0 ] }, "down": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 4.0 ] } } }, { "name": "Border", "from": [ 12.0, 12.0, 7.0 ], "to": [ 14.0, 13.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 2.0, 3.0, 4.0, 4.0 ] }, "east": { "texture": "#0", "uv": [ 2.0, 3.0, 3.0, 4.0 ] }, "south": { "texture": "#0", "uv": [ 2.0, 3.0, 4.0, 4.0 ] }, "west": { "texture": "#0", "uv": [ 3.0, 3.0, 4.0, 4.0 ] }, "up": { "texture": "#0", "uv": [ 2.0, 3.0, 4.0, 4.0 ] }, "down": { "texture": "#0", "uv": [ 2.0, 3.0, 4.0, 4.0 ] } } }, { "name": "Border", "from": [ 4.0, 13.0, 7.0 ], "to": [ 7.0, 14.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 9.0, 2.0, 12.0, 3.0 ] }, "east": { "texture": "#0", "uv": [ 9.0, 2.0, 10.0, 3.0 ] }, "south": { "texture": "#0", "uv": [ 9.0, 2.0, 12.0, 3.0 ] }, "west": { "texture": "#0", "uv": [ 11.0, 2.0, 12.0, 3.0 ] }, "up": { "texture": "#0", "uv": [ 9.0, 2.0, 12.0, 3.0 ] }, "down": { "texture": "#0", "uv": [ 9.0, 2.0, 12.0, 3.0 ] } } }, { "name": "Border", "from": [ 9.0, 13.0, 7.0 ], "to": [ 12.0, 14.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 4.0, 2.0, 7.0, 3.0 ] }, "east": { "texture": "#0", "uv": [ 4.0, 2.0, 5.0, 3.0 ] }, "south": { "texture": "#0", "uv": [ 4.0, 2.0, 7.0, 3.0 ] }, "west": { "texture": "#0", "uv": [ 6.0, 2.0, 7.0, 3.0 ] }, "up": { "texture": "#0", "uv": [ 4.0, 2.0, 7.0, 3.0 ] }, "down": { "texture": "#0", "uv": [ 4.0, 2.0, 7.0, 3.0 ] } } }, { "name": "Border", "from": [ 7.0, 14.0, 7.0 ], "to": [ 9.0, 15.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 7.0, 1.0, 9.0, 2.0 ] }, "east": { "texture": "#0", "uv": [ 7.0, 1.0, 8.0, 2.0 ] }, "south": { "texture": "#0", "uv": [ 7.0, 1.0, 9.0, 2.0 ] }, "west": { "texture": "#0", "uv": [ 8.0, 1.0, 9.0, 2.0 ] }, "up": { "texture": "#0", "uv": [ 7.0, 1.0, 9.0, 2.0 ] }, "down": { "texture": "#0", "uv": [ 7.0, 1.0, 9.0, 2.0 ] } } }, { "name": "Inside", "from": [ 4.0, 4.0, 7.0 ], "to": [ 12.0, 13.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 4.0, 3.0, 12.0, 12.0 ] }, "east": { "texture": "#0", "uv": [ 4.0, 3.0, 5.0, 12.0 ] }, "south": { "texture": "#0", "uv": [ 4.0, 3.0, 12.0, 12.0 ] }, "west": { "texture": "#0", "uv": [ 11.0, 3.0, 12.0, 12.0 ] }, "up": { "texture": "#0", "uv": [ 4.0, 3.0, 12.0, 4.0 ] }, "down": { "texture": "#0", "uv": [ 4.0, 11.0, 12.0, 12.0 ] } } }, { "name": "Inside", "from": [ 5.0, 3.0, 7.0 ], "to": [ 11.0, 4.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 12.0, 11.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 12.0, 11.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 10.0, 12.0, 11.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 12.0, 11.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 12.0, 11.0, 13.0 ] } } }, { "name": "Inside", "from": [ 7.0, 2.0, 7.0 ], "to": [ 9.0, 3.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 7.0, 13.0, 9.0, 14.0 ] }, "east": { "texture": "#0", "uv": [ 7.0, 13.0, 8.0, 14.0 ] }, "south": { "texture": "#0", "uv": [ 7.0, 13.0, 9.0, 14.0 ] }, "west": { "texture": "#0", "uv": [ 8.0, 13.0, 9.0, 14.0 ] }, "up": { "texture": "#0", "uv": [ 7.0, 13.0, 9.0, 14.0 ] }, "down": { "texture": "#0", "uv": [ 7.0, 13.0, 9.0, 14.0 ] } } }, { "name": "Inside", "from": [ 7.0, 13.0, 7.0 ], "to": [ 9.0, 14.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 3.0 ] }, "east": { "texture": "#0", "uv": [ 7.0, 2.0, 8.0, 3.0 ] }, "south": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 3.0 ] }, "west": { "texture": "#0", "uv": [ 8.0, 2.0, 9.0, 3.0 ] }, "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 3.0 ] }, "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 3.0 ] } } }, { "name": "Inside", "from": [ 3.0, 7.0, 7.0 ], "to": [ 4.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 9.0 ] }, "east": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 9.0 ] }, "south": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 9.0 ] }, "west": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 9.0 ] }, "up": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 12.0, 8.0, 13.0, 9.0 ] } } }, { "name": "Inside", "from": [ 2.0, 10.0, 7.0 ], "to": [ 3.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 6.0 ] }, "east": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 6.0 ] }, "south": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 6.0 ] }, "west": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 6.0 ] }, "up": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 13.0, 5.0, 14.0, 6.0 ] } } }, { "name": "Inside", "from": [ 12.0, 7.0, 7.0 ], "to": [ 13.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 9.0 ] }, "east": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 9.0 ] }, "south": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 9.0 ] }, "west": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 9.0 ] }, "up": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 3.0, 8.0, 4.0, 9.0 ] } } }, { "name": "Inside", "from": [ 13.0, 10.0, 7.0 ], "to": [ 14.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 6.0 ] }, "east": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 6.0 ] }, "south": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 6.0 ] }, "west": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 6.0 ] }, "up": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 2.0, 5.0, 3.0, 6.0 ] } } }, { "name": "Inside", "from": [ 9.0, 8.0, 8.0 ], "to": [ 10.0, 9.0, 9.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] } } }, { "name": "Inside", "from": [ 6.0, 8.0, 8.0 ], "to": [ 7.0, 9.0, 9.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] } } }, { "name": "Inside", "from": [ 6.0, 8.0, 9.0 ], "to": [ 10.0, 9.0, 10.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] } } } ] } [blocking Model] { "textures": { "0": "betterlife:items/shield_iron" }, "display": { "thirdperson_righthand": { "rotation": [ 45, 0, -10 ], "translation": [ 0, 4.0, 2.5 ], "scale": [ 0.85, 0.85, 0.85 ] }, "thirdperson_lefthand": { "rotation": [ 45, 0, -10 ], "translation": [ 0, 4.0, 2.5 ], "scale": [ 0.85, 0.85, 0.85 ] }, "firstperson_righthand": { "rotation": [ 45, 90, -10 ], "translation": [ 0, 0, 0 ], "scale": [ 0.68, 0.68, 0.68 ] }, "firstperson_lefthand": { "rotation": [ 45, 90, -10 ], "translation": [ 0, 0, 0 ], "scale": [ 0.68, 0.68, 0.68 ] } } } [shieldIron.class] package shield; import java.util.List; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ShieldIron extends ShieldBase { public ShieldIron () { super( "shield_iron" , 340 , 13 , 2 * 60 * 20 , false ); } public int getItemEnchantability () { return 0; } } Second problem: I made four textures for my golden bow and the models. When I pull the bow, only the standy-model and the first pulling-model get loaded. [Models] bow_gold.json { "parent": "item/generated", "textures": { "layer0": "betterlife:items/bow_gold_standby" }, "display": { "thirdperson_righthand": { "rotation": [ -80, 260, -40 ], "translation": [ -1, -2, 2.5 ], "scale": [ 0.9, 0.9, 0.9 ] }, "thirdperson_lefthand": { "rotation": [ -80, -280, 40 ], "translation": [ -1, -2, 2.5 ], "scale": [ 0.9, 0.9, 0.9 ] }, "firstperson_righthand": { "rotation": [ 0, -90, 25 ], "translation": [ 1.13, 3.2, 1.13], "scale": [ 0.68, 0.68, 0.68 ] }, "firstperson_lefthand": { "rotation": [ 0, 90, -25 ], "translation": [ 1.13, 3.2, 1.13], "scale": [ 0.68, 0.68, 0.68 ] } }, "overrides": [ { "predicate": { "pulling": 1 }, "model": "betterlife:item/bow_gold_pulling_0" }, { "predicate": { "pulling": 1, "pull": 0.65 }, "model": "betterlife:item/bow_gold_pulling_1" }, { "predicate": { "pulling": 1, "pull": 0.9 }, "model": "betterlife:item/bow_gold_pulling_2" } ] } bow_gold_pulling_0.json { "parent": "betterlife:item/bow_gold", "textures": { "layer0": "betterlife:items/bow_gold_pulling_0" } } bow_gold_pulling_1.json { "parent": "betterlife:item/bow_gold", "textures": { "layer0": "betterlife:items/bow_gold_pulling_1" } } bow_gold_pulling_2.json { "parent": "betterlife:item/bow_gold", "textures": { "layer0": "betterlife:items/bow_gold_pulling_2" } }
  9. It tried what you told me but it is NOT working. The shield has a "blocking"-animation but this animation is from the normal shield and not mine. I was pissed and so I started working on my bow. Guess what... Same problem. There are 4 textures for the bow and by pulling it, just the first will be displayed. The zoom also doesn't get changed... EDIT: I just copy-pasted the code from the "ItemBow"-class and it isn't working either. I even just copied the json-files and just replaced the texture things but it ISN'T working. Why?! :'( I am despairing.
  10. Sure. Here's my src: https://github.com/LyrasDerEchte/-Forge-BetterLife
  11. I have looked through the important classes and files but I cannot find my mistake. Do you know where my mistake is? I think it would be great if you show me my fault. Thanks in advance
  12. package shield; public class ShieldIron extends ShieldBase { public ShieldIron () { super( "shield_iron" , 340 , 13 , 2 * 60 * 20 , false ); } public int getItemEnchantability () { return 0; } } I named the standard model for my shield "shield_iron", just like in the class. And because It's a shield I want I to block when right clicking it. It does but it doesn't use my .json (shield_iron_blocking) as a model when blocking. It seems like it uses the standard model from minecraft for blocking. There's a similar post: http://www.minecraftforge.net/forum/index.php/topic,38828.msg204203.html#msg204203 I made it like him but my shield doesn't use my blocking-model Obviously it works for him and many others around the internet ._.
  13. Hey, I'm currently creating my own type of shield but the model for blocking isn't working very well package shield; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.IItemPropertyGetter; import net.minecraft.item.ItemShield; import net.minecraft.item.ItemStack; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ShieldBase extends ItemShield { private boolean soulbound = false; private int chanceNotBlock; // This means 1 in [number] private int maxDamage; private int maxUseDuration; public ShieldBase ( String name , int maxDamage , int chanceNotBlock , int maxUseDuration , boolean soulbound ) { this.setCreativeTab( CreativeTabs.tabCombat ); this.setRegistryName( name ); this.setUnlocalizedName( name ); this.soulbound = soulbound; this.setMaxDamage( maxDamage ); this.maxDamage = maxDamage; this.setMaxStackSize( 1 ); this.chanceNotBlock = chanceNotBlock; this.maxUseDuration = maxUseDuration; this.addPropertyOverride( new ResourceLocation( "blocking" ) , new IItemPropertyGetter() { @SideOnly( Side.CLIENT ) public float apply ( ItemStack stack , World worldIn , EntityLivingBase entityIn ) { return entityIn != null && entityIn.isHandActive() && entityIn.getActiveItemStack() == stack ? 1.0F : 0.0F; } } ); } public EnumAction getItemUseAction ( ItemStack stack ) { return EnumAction.BLOCK; } public int getMaxItemUseDuration ( ItemStack stack ) { return this.getMaxUseDuration() * 20; } public ActionResult < ItemStack > onItemRightClick ( ItemStack stack , World world , EntityPlayer player , EnumHand hand) { player.setActiveHand( hand ); return new ActionResult( EnumActionResult.SUCCESS , stack ); } public String getSimpleName () { return this.getUnlocalizedName().substring( 5 ); } public boolean isSoulbound () { return soulbound; } public void setSoulbound ( boolean bool ) { this.soulbound = bool; } public int getMaxDamage () { return this.maxDamage; } public int getChanceNotBlock () { return this.chanceNotBlock; } public int getMaxUseDuration () { return this.maxUseDuration; } } [shieldBase; ShieldIron extends from this class] { "textures": { "0": "betterlife:items/shield_iron" }, "elements": [ { "name": "Border", "from": [ 7.0, 1.0, 7.0 ], "to": [ 9.0, 2.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 15.0 ] }, "east": { "texture": "#0", "uv": [ 7.0, 14.0, 8.0, 15.0 ] }, "south": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 15.0 ] }, "west": { "texture": "#0", "uv": [ 8.0, 14.0, 9.0, 15.0 ] }, "up": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 15.0 ] }, "down": { "texture": "#0", "uv": [ 7.0, 14.0, 9.0, 15.0 ] } } }, { "name": "Border", "from": [ 5.0, 2.0, 7.0 ], "to": [ 7.0, 3.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 9.0, 13.0, 11.0, 14.0 ] }, "east": { "texture": "#0", "uv": [ 9.0, 13.0, 10.0, 14.0 ] }, "south": { "texture": "#0", "uv": [ 9.0, 13.0, 11.0, 14.0 ] }, "west": { "texture": "#0", "uv": [ 10.0, 13.0, 11.0, 14.0 ] }, "up": { "texture": "#0", "uv": [ 9.0, 13.0, 11.0, 14.0 ] }, "down": { "texture": "#0", "uv": [ 9.0, 13.0, 11.0, 14.0 ] } } }, { "name": "Border", "from": [ 9.0, 2.0, 7.0 ], "to": [ 11.0, 3.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 13.0, 7.0, 14.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 13.0, 6.0, 14.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 13.0, 7.0, 14.0 ] }, "west": { "texture": "#0", "uv": [ 6.0, 13.0, 7.0, 14.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 13.0, 7.0, 14.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 13.0, 7.0, 14.0 ] } } }, { "name": "Border", "from": [ 4.0, 3.0, 7.0 ], "to": [ 5.0, 4.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 11.0, 12.0, 12.0, 13.0 ] } } }, { "name": "Border", "from": [ 11.0, 3.0, 7.0 ], "to": [ 12.0, 4.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 4.0, 12.0, 5.0, 13.0 ] } } }, { "name": "Border", "from": [ 3.0, 4.0, 7.0 ], "to": [ 4.0, 7.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 12.0, 9.0, 13.0, 12.0 ] }, "east": { "texture": "#0", "uv": [ 12.0, 9.0, 13.0, 12.0 ] }, "south": { "texture": "#0", "uv": [ 12.0, 9.0, 13.0, 12.0 ] }, "west": { "texture": "#0", "uv": [ 12.0, 9.0, 13.0, 12.0 ] }, "up": { "texture": "#0", "uv": [ 13.0, 9.0, 12.0, 10.0 ] }, "down": { "texture": "#0", "uv": [ 12.0, 11.0, 13.0, 12.0 ] } } }, { "name": "Border", "from": [ 12.0, 4.0, 7.0 ], "to": [ 13.0, 7.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 12.0 ] }, "east": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 12.0 ] }, "south": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 12.0 ] }, "west": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 12.0 ] }, "up": { "texture": "#0", "uv": [ 3.0, 9.0, 4.0, 10.0 ] }, "down": { "texture": "#0", "uv": [ 3.0, 11.0, 4.0, 12.0 ] } } }, { "name": "Border", "from": [ 2.0, 7.0, 7.0 ], "to": [ 3.0, 10.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 9.0 ] }, "east": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 9.0 ] }, "south": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 9.0 ] }, "west": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 9.0 ] }, "up": { "texture": "#0", "uv": [ 13.0, 6.0, 14.0, 7.0 ] }, "down": { "texture": "#0", "uv": [ 13.0, 8.0, 14.0, 9.0 ] } } }, { "name": "Border", "from": [ 13.0, 7.0, 7.0 ], "to": [ 14.0, 10.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 9.0 ] }, "east": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 9.0 ] }, "south": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 9.0 ] }, "west": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 9.0 ] }, "up": { "texture": "#0", "uv": [ 2.0, 6.0, 3.0, 7.0 ] }, "down": { "texture": "#0", "uv": [ 2.0, 8.0, 3.0, 9.0 ] } } }, { "name": "Border", "from": [ 1.0, 10.0, 7.0 ], "to": [ 2.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 6.0 ] }, "east": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 6.0 ] }, "south": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 6.0 ] }, "west": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 6.0 ] }, "up": { "texture": "#0", "uv": [ 14.0, 4.0, 15.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 14.0, 5.0, 15.0, 6.0 ] } } }, { "name": "Border", "from": [ 14.0, 10.0, 7.0 ], "to": [ 15.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 6.0 ] }, "east": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 6.0 ] }, "south": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 6.0 ] }, "west": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 6.0 ] }, "up": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 1.0, 4.0, 2.0, 5.0 ] } } }, { "name": "Border", "from": [ 2.0, 12.0, 7.0 ], "to": [ 4.0, 13.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 4.0 ] }, "east": { "texture": "#0", "uv": [ 12.0, 3.0, 13.0, 4.0 ] }, "south": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 4.0 ] }, "west": { "texture": "#0", "uv": [ 13.0, 3.0, 14.0, 4.0 ] }, "up": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 4.0 ] }, "down": { "texture": "#0", "uv": [ 12.0, 3.0, 14.0, 4.0 ] } } }, { "name": "Border", "from": [ 12.0, 12.0, 7.0 ], "to": [ 14.0, 13.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 2.0, 3.0, 4.0, 4.0 ] }, "east": { "texture": "#0", "uv": [ 2.0, 3.0, 3.0, 4.0 ] }, "south": { "texture": "#0", "uv": [ 2.0, 3.0, 4.0, 4.0 ] }, "west": { "texture": "#0", "uv": [ 3.0, 3.0, 4.0, 4.0 ] }, "up": { "texture": "#0", "uv": [ 2.0, 3.0, 4.0, 4.0 ] }, "down": { "texture": "#0", "uv": [ 2.0, 3.0, 4.0, 4.0 ] } } }, { "name": "Border", "from": [ 4.0, 13.0, 7.0 ], "to": [ 7.0, 14.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 9.0, 2.0, 12.0, 3.0 ] }, "east": { "texture": "#0", "uv": [ 9.0, 2.0, 10.0, 3.0 ] }, "south": { "texture": "#0", "uv": [ 9.0, 2.0, 12.0, 3.0 ] }, "west": { "texture": "#0", "uv": [ 11.0, 2.0, 12.0, 3.0 ] }, "up": { "texture": "#0", "uv": [ 9.0, 2.0, 12.0, 3.0 ] }, "down": { "texture": "#0", "uv": [ 9.0, 2.0, 12.0, 3.0 ] } } }, { "name": "Border", "from": [ 9.0, 13.0, 7.0 ], "to": [ 12.0, 14.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 4.0, 2.0, 7.0, 3.0 ] }, "east": { "texture": "#0", "uv": [ 4.0, 2.0, 5.0, 3.0 ] }, "south": { "texture": "#0", "uv": [ 4.0, 2.0, 7.0, 3.0 ] }, "west": { "texture": "#0", "uv": [ 6.0, 2.0, 7.0, 3.0 ] }, "up": { "texture": "#0", "uv": [ 4.0, 2.0, 7.0, 3.0 ] }, "down": { "texture": "#0", "uv": [ 4.0, 2.0, 7.0, 3.0 ] } } }, { "name": "Border", "from": [ 7.0, 14.0, 7.0 ], "to": [ 9.0, 15.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 7.0, 1.0, 9.0, 2.0 ] }, "east": { "texture": "#0", "uv": [ 7.0, 1.0, 8.0, 2.0 ] }, "south": { "texture": "#0", "uv": [ 7.0, 1.0, 9.0, 2.0 ] }, "west": { "texture": "#0", "uv": [ 8.0, 1.0, 9.0, 2.0 ] }, "up": { "texture": "#0", "uv": [ 7.0, 1.0, 9.0, 2.0 ] }, "down": { "texture": "#0", "uv": [ 7.0, 1.0, 9.0, 2.0 ] } } }, { "name": "Inside", "from": [ 4.0, 4.0, 7.0 ], "to": [ 12.0, 13.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 4.0, 3.0, 12.0, 12.0 ] }, "east": { "texture": "#0", "uv": [ 4.0, 3.0, 5.0, 12.0 ] }, "south": { "texture": "#0", "uv": [ 4.0, 3.0, 12.0, 12.0 ] }, "west": { "texture": "#0", "uv": [ 11.0, 3.0, 12.0, 12.0 ] }, "up": { "texture": "#0", "uv": [ 4.0, 3.0, 12.0, 4.0 ] }, "down": { "texture": "#0", "uv": [ 4.0, 11.0, 12.0, 12.0 ] } } }, { "name": "Inside", "from": [ 5.0, 3.0, 7.0 ], "to": [ 11.0, 4.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 12.0, 11.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 12.0, 11.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 10.0, 12.0, 11.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 12.0, 11.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 12.0, 11.0, 13.0 ] } } }, { "name": "Inside", "from": [ 7.0, 2.0, 7.0 ], "to": [ 9.0, 3.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 7.0, 13.0, 9.0, 14.0 ] }, "east": { "texture": "#0", "uv": [ 7.0, 13.0, 8.0, 14.0 ] }, "south": { "texture": "#0", "uv": [ 7.0, 13.0, 9.0, 14.0 ] }, "west": { "texture": "#0", "uv": [ 8.0, 13.0, 9.0, 14.0 ] }, "up": { "texture": "#0", "uv": [ 7.0, 13.0, 9.0, 14.0 ] }, "down": { "texture": "#0", "uv": [ 7.0, 13.0, 9.0, 14.0 ] } } }, { "name": "Inside", "from": [ 7.0, 13.0, 7.0 ], "to": [ 9.0, 14.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 3.0 ] }, "east": { "texture": "#0", "uv": [ 7.0, 2.0, 8.0, 3.0 ] }, "south": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 3.0 ] }, "west": { "texture": "#0", "uv": [ 8.0, 2.0, 9.0, 3.0 ] }, "up": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 3.0 ] }, "down": { "texture": "#0", "uv": [ 7.0, 2.0, 9.0, 3.0 ] } } }, { "name": "Inside", "from": [ 3.0, 7.0, 7.0 ], "to": [ 4.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 9.0 ] }, "east": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 9.0 ] }, "south": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 9.0 ] }, "west": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 9.0 ] }, "up": { "texture": "#0", "uv": [ 12.0, 4.0, 13.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 12.0, 8.0, 13.0, 9.0 ] } } }, { "name": "Inside", "from": [ 2.0, 10.0, 7.0 ], "to": [ 3.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 6.0 ] }, "east": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 6.0 ] }, "south": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 6.0 ] }, "west": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 6.0 ] }, "up": { "texture": "#0", "uv": [ 13.0, 4.0, 14.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 13.0, 5.0, 14.0, 6.0 ] } } }, { "name": "Inside", "from": [ 12.0, 7.0, 7.0 ], "to": [ 13.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 9.0 ] }, "east": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 9.0 ] }, "south": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 9.0 ] }, "west": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 9.0 ] }, "up": { "texture": "#0", "uv": [ 3.0, 4.0, 4.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 3.0, 8.0, 4.0, 9.0 ] } } }, { "name": "Inside", "from": [ 13.0, 10.0, 7.0 ], "to": [ 14.0, 12.0, 8.0 ], "faces": { "north": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 6.0 ] }, "east": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 6.0 ] }, "south": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 6.0 ] }, "west": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 6.0 ] }, "up": { "texture": "#0", "uv": [ 2.0, 4.0, 3.0, 5.0 ] }, "down": { "texture": "#0", "uv": [ 2.0, 5.0, 3.0, 6.0 ] } } }, { "name": "Inside", "from": [ 9.0, 8.0, 8.0 ], "to": [ 10.0, 9.0, 9.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] } } }, { "name": "Inside", "from": [ 6.0, 8.0, 8.0 ], "to": [ 7.0, 9.0, 9.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] } } }, { "name": "Inside", "from": [ 6.0, 8.0, 9.0 ], "to": [ 10.0, 9.0, 10.0 ], "faces": { "north": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "east": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "south": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "west": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "up": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] }, "down": { "texture": "#0", "uv": [ 5.0, 12.0, 6.0, 13.0 ] } } } ], "display": { "thirdperson_righthand": { "rotation": [ 90, -75, 90 ], "translation": [ 2, -2, 1 ], "scale": [ 0.9, 0.9, 0.9 ] }, "thirdperson_lefthand": { "rotation": [ 90, -75, 90 ], "translation": [ 2, -2, 1 ], "scale": [ 0.9, 0.9, 0.9 ] }, "firstperson_righthand": { "rotation": [ 10, -15, -3 ], "translation": [ 0, 0, 0 ], "scale": [ 0.9, 0.9, 0.9 ] }, "firstperson_lefthand": { "rotation": [ 10, -15, -3 ], "translation": [ 0, 0, 0 ], "scale": [ 0.9, 0.9, 0.9 ] }, "gui": { "rotation": [ 0, 180, 0 ], "translation": [ 0, 0, 0 ], "scale": [ 1, 1, 1 ] } }, "overrides": [ { "predicate": { "blocking": 1 }, "model": "betterlife:item/shield_iron_blocking" } ] } [shield_iron.json] { "display": { "thirdperson_righthand": { "rotation": [ 45, 135, 0 ], "translation": [ 3.51, 11, -2 ], "scale": [ 1, 1, 1 ] }, "thirdperson_lefthand": { "rotation": [ 45, 135, 0 ], "translation": [ 13.51, 3, 5 ], "scale": [ 1, 1, 1 ] }, "firstperson_righthand": { "rotation": [ 0, 180, -5 ], "translation": [ -15, 5, -11 ], "scale": [ 1.25, 1.25, 1.25 ] }, "firstperson_lefthand": { "rotation": [ 0, 180, -5 ], "translation": [ 5, 5, -11 ], "scale": [ 1.25, 1.25, 1.25 ] }, "gui": { "rotation": [ 15, -25, -5 ], "translation": [ 2, 3, 0 ], "scale": [ 0.65, 0.65, 0.65 ] } } } [shield_iron_blocking.json] The first model ( not blocking ) is working fine but the second one obviously doesn't get registered or something like that. When I change code in the .json, then nothing will happen to the model :c
  14. The method gets called. Scenario: I've got my flute. When I'm not sneaking and press the item it will play record_flute1 but when I'm sneaking and press the item, it should play record_flute2. When I'm not sneaking it will play the sound and when I'm sneaking it will not. I already copied record_flute1 and named it record_flute2 so that I have both files BUT they are the same. Then I tested again and realized that I actually just plays record_flute1 but not record_flute2. The base problem is commensurately that just the record_flute1 can be played.
  15. Problem: New sounds don't get registered. package registry; import core.ModBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraftforge.fml.common.registry.GameRegistry; public class SoundRegistry { public static SoundEvent record_flute1; public static SoundEvent record_flute2; public static void registerSounds () { record_flute1 = registerSound( "record.flute1" ); record_flute2 = registerSound( "record.flute2" ); } private static SoundEvent registerSound ( String soundName ) { ResourceLocation res = new ResourceLocation ( ModBase.ID , soundName ); return GameRegistry.register( new SoundEvent( res ).setRegistryName( res ) ); } } package item; import handler.SoundHandler; import net.minecraft.client.Minecraft; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; import registry.SoundRegistry; public class ItemPanFlute extends ItemBase { public ItemPanFlute () { super( "pan_flute" , false ); this.setCreativeTab( CreativeTabs.tabTools ); this.setMaxStackSize( 1 ); this.setMaxDamage( 500 ); } @Override public ActionResult < ItemStack > onItemRightClick ( ItemStack itemstack , World world , EntityPlayer player , EnumHand hand ) { try { if ( itemstack.getTagCompound().hasNoTags() || ( world.getTotalWorldTime() - itemstack.getTagCompound().getLong( "world_time" ) ) >= 5 ) { if ( !world.isRemote ) { float rotationPitch = ( ( - ( player.rotationPitch ) ) / 360 ); float soundPitch = ( float ) ( rotationPitch + 1.375 ); if ( !player.isSneaking() ) { SoundHandler.playSoundInRadius( player , 25 , SoundRegistry.record_flute1 , ( float ) 0.5 , soundPitch ); } else { SoundHandler.playSoundInRadius( player , 25 , SoundRegistry.record_flute2 , ( float ) 0.5 , soundPitch ); } itemstack.getTagCompound().setLong( "world_time" , world.getTotalWorldTime() ); itemstack.damageItem( 1 , player ); } } } catch ( Exception ex ) {} return super.onItemRightClick( itemstack , world , player , hand ); } @Override public void onUpdate ( ItemStack itemstack , World world , Entity entity , int metadata , boolean bool ) { if ( itemstack.getTagCompound() == null ) { itemstack.setTagCompound( new NBTTagCompound() ); } } } { "record.flute1": { "category": "record", "sounds": [ { "name": "betterlife:flute1", "stream": true } ] } , "record.flute2": { "category": "record", "sounds": [ { "name": "betterlife:flute2", "stream": true } ] } } As you can see in the 2nd code snippet: When the player sneaks and right clicks the item, the 2nd sound should be played. But this doesn't work.
  16. Thanks for the tip with the client and server side.
  17. package item; import handler.SoundHandler; import net.minecraft.client.Minecraft; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; import proxy.SoundRegistry; public class ItemPanFlute extends ItemBase { public ItemPanFlute () { super( "pan_flute" , false ); this.setCreativeTab( CreativeTabs.tabTools ); this.setMaxStackSize( 1 ); this.setMaxDamage( 500 ); } @Override public ActionResult < ItemStack > onItemRightClick ( ItemStack itemstack , World world , EntityPlayer player , EnumHand hand ) { try { if ( itemstack.getTagCompound().hasNoTags() || ( world.getTotalWorldTime() - itemstack.getTagCompound().getLong( "world_time" ) ) >= 20 ) { float rotationPitch = ( ( - ( player.rotationPitch ) ) / 360 ); float soundPitch = ( float ) ( rotationPitch + 1.125 ); if ( !player.isSneaking() ) { SoundHandler.playSoundInRadius( player , 25 , SoundRegistry.record_flute , 1 , soundPitch ); } else { SoundHandler.playSoundInRadius( player , 25 , SoundRegistry.record_flute , 1 , ( float ) ( soundPitch + 0.25 ) ); } itemstack.getTagCompound().setLong( "world_time" , world.getTotalWorldTime() ); itemstack.damageItem( 1 , player ); } } catch ( Exception ex ) {} return super.onItemRightClick( itemstack , world , player , hand ); } @Override public void onUpdate ( ItemStack itemstack , World world , Entity entity , int metadata , boolean bool ) { if ( itemstack.getTagCompound() == null ) { itemstack.setTagCompound( new NBTTagCompound() ); } } } I did what you said and it worked, thank you Incidentally, I have noticed that the click method is called 2 times per click and sometimes a "ConcurrentModificationException" gets thrown. And that's because I want the click method just to call 1 time each click. xP java.util.ConcurrentModificationException at com.google.common.collect.HashBiMap$Itr.checkForConcurrentModification(HashBiMap.java:339) at com.google.common.collect.HashBiMap$Itr.hasNext(HashBiMap.java:345) at net.minecraft.client.audio.SoundManager.updateAllSounds(SoundManager.java:266) at net.minecraft.client.audio.SoundHandler.update(SoundHandler.java:269) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1891) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1114) at net.minecraft.client.Minecraft.run(Minecraft.java:401) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) Can you help me there? This would be pretty nice. Danke im Vorraus Grüße, Lyras
  18. Hey, I made a "pan-flute" and it works. But there is a little problem: When I press very often, the flute sounds crappy because the sounds overlap... How can I toggle the "item use"? I mean, that just every second or something like that, a sound can be played. package item; import handler.SoundHandler; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; import proxy.SoundRegistry; public class ItemPanFlute extends ItemBase { public ItemPanFlute () { super( "pan_flute" , false ); this.setCreativeTab( CreativeTabs.tabTools ); } @Override public ActionResult < ItemStack > onItemRightClick ( ItemStack itemStack , World world , EntityPlayer player , EnumHand hand ) { float rotationPitch = ( ( - ( player.rotationPitch ) ) / 360 ); float soundPitch = ( float ) ( rotationPitch + 1.125 ); if ( !player.isSneaking() ) { SoundHandler.playSoundInRadius( player , 25 , SoundRegistry.record_flute , 1 , soundPitch ); } else { SoundHandler.playSoundInRadius( player , 25 , SoundRegistry.record_flute , 1 , ( float ) ( soundPitch + 0.25 ) ); } return super.onItemRightClick( itemStack , world , player , hand ); } }
  19. Hey, yesterday I downloaded the 1.9-API to start my new project but when I started coding, I realized that I cannot get access to see the source code D: In the 1.8-API I can see it. Is that been made aware? It would be super useful when I could see the code ;P
  20. And I just have to send a packet to the server with the "command" let the horse move there? But then there is another problem: I don't know which existing way I should chose to let the horse move. Or is there any way?
  21. And how to move it on the server? xP And is there an existing function?
  22. But is there a way to move the horse for the client and for the server?
  23. Is there no easier way? And will the horse also be moved on a server too? EDIT: I have no idea how to do it. I tried but I cannot figure it out... There must be a way to move the entity without calculating vectors etc. I guess that I even have to check if the horse has to jump because a block is in front of it
  24. 1. With "test for key input", the InputEvent is meant. 2. In my code you can see a "MarkerPoint"-object. This includes values such as x , y and z coordinates. What I want is to move the horse to the coordinates which are included in the object
  25. This is my class in which I test for key input But it isn't nessecary for my question: How to move my horse?
×
×
  • Create New...

Important Information

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