dragnoz

How to calculate give item damage value for custom models

Feb 20th, 2016
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. Diamond Hoe = damage 1561
  2.  
  3. Move comma two places to get percent (the number on the left is the number you will use in your JSON file)
  4. 0.10 = 10%
  5.  
  6. get percentage of damage value
  7. 1561 / 10 % = 156.1
  8.  
  9. Drop everything after the comma value and add 1
  10. 156 + 1 = 157
  11.  
  12. use answer as damage value in give or summon command
  13. /give @p minecraft:diamond_hoe 1 157 {Unbreakable:1}
  14.  
  15. Remember to summon item with the unbreakable tag else the first time the item is used it will get damaged and will be replaced by next model.
  16.  
  17. EXAMPLES
  18. Percent = damage value in texture file [summon / give damage value]
  19. 1% = 0.01 [16]
  20. 1.1% = 0.011 [18]
  21. 1.2% = 0.012 [19]
  22. 1.3% = 0.013 [21]
  23. 1.4% = 0.014 [22]
  24. 1.5% = 0.015 [21]
  25. 10% = 0.1 [157]
  26. 10.1% = 0.101 [158]
  27. 12% = 0.12 [188]
  28. 12.1% = 0.121 [189]
  29. 20% = 0.2 [313]
  30. 20.1% = 0.201 [314]
  31. 30% = 0.3 [469]
  32. 31% = 0.31 [484]
  33. 40% = 0.4 [625]
  34. 40.1% - 0.401 [626]
  35. 40.2% = 0.402 [628]
  36. 40.3% = 0.403 [630]
  37. 40.4% = 0.404 [631]
  38. 40.5% = 0.405 [633]
  39. 40.6% = 0.406 [634]
  40. 40.7% = 0.407 [636]
  41. 40.8% = 0.408 [637]
  42. 40.9% = 0.409 [639]
  43. 41% = 0.41 [641]
  44. 41.1% = 0.411 [642]
  45. 41.2% = 0.412 [644]
  46. 41.3% = 0.413 [645]
  47. 41.4% = 0.414 [647]
  48. 41.5% = 0.415 [648]
  49. 41.6% = 0.416 [651]
  50. 41.7% = 0.417 [650]
  51. 41.8% = 0.418 [653]
  52. 41.9% = 0.419 [655]
  53. 42% = 0.42 [650]
  54.  
  55.  
  56. LionS = 16
  57. LionW = 18
  58. RhinoS = 19
  59. RhinoW = 21
  60. GiraffeS = 157
  61. GiraffeW = 158
  62. PangolinS = 188
  63. PangolinW = 189
  64. VultureS = 313
  65. VultureF = 314
  66. ElephantS = 469
  67. ElephantW = 484
  68. Baloon = 625
  69. Jeep = 626
  70. Camera = 628
  71. RhinoHorn = 630
  72. ElephantTusk = 631
  73. villageman = 633
  74. Night Vision Goggles = 634
  75. Binoculars = 636
  76. Turtle = 637
  77. TurtleW = 639
  78. Hippo1 = 641
  79. Hippo2 = 642
  80. exclaimationmark = 644
  81. Prisoner = 645
  82. GPS = 648
  83. VuVuZela = 647
  84. Hyena walking = 650
  85. Hyena standing = 651
  86. Porcpine Walking = 653
  87. Porcupine standing = 655
  88.  
  89. scoreboard players set @a nightvision 4 {Inventory:[{id:"minecraft:diamond_hoe",Slot:-106b,Damage:634s}]}
  90.  
  91. /give @p minecraft:diamond_hoe 1 634 {Unbreakable:1,display:{Name:"Night Vision Goggles"}}
  92. /give @p minecraft:diamond_hoe 1 636 {Unbreakable:1,display:{Name:"Binoculars"}}
  93.  
  94. ------ code below thanks to samasaurus6 ------
  95. https://www.youtube.com/watch?v=n1_l5hhU14w
  96.  
  97. {
  98. "parent": "item/handheld",
  99. "textures": {
  100. "layer0": "items/wood_sword"
  101. },
  102. "overrides": [
  103. { "predicate": { "damaged": 1, "damage": 0.01}, "model": "item/wooden_sword1"},
  104. { "predicate": { "damaged": 1, "damage": 0.011}, "model": "item/wooden_sword2"},
  105. { "predicate": { "damaged": 1, "damage": 0.1}, "model": "item/wooden_sword3"}
  106. ]
  107. }
Add Comment
Please, Sign In to add comment