Advertisement
Luigi9999999999

Procedure Code

Dec 24th, 2018
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.28 KB | None | 0 0
  1. package mod.mcreator;
  2.  
  3. import net.minecraft.world.World;
  4. import net.minecraft.item.ItemStack;
  5. import net.minecraft.entity.player.EntityPlayer;
  6. import net.minecraft.entity.item.EntityItem;
  7. import net.minecraft.entity.EntityLivingBase;
  8. import net.minecraft.entity.Entity;
  9.  
  10. import java.util.HashMap;
  11.  
  12. public class mcreator_generalMobDropP extends testenvironmentmod.ModElement {
  13.  
  14. public static void executeProcedure(java.util.HashMap<String, Object> dependencies) {
  15. if (dependencies.get("entity") == null) {
  16. System.err.println("Failed to load dependency entity for procedure generalMobDropP!");
  17. return;
  18. }
  19. if (dependencies.get("x") == null) {
  20. System.err.println("Failed to load dependency x for procedure generalMobDropP!");
  21. return;
  22. }
  23. if (dependencies.get("y") == null) {
  24. System.err.println("Failed to load dependency y for procedure generalMobDropP!");
  25. return;
  26. }
  27. if (dependencies.get("z") == null) {
  28. System.err.println("Failed to load dependency z for procedure generalMobDropP!");
  29. return;
  30. }
  31. if (dependencies.get("world") == null) {
  32. System.err.println("Failed to load dependency world for procedure generalMobDropP!");
  33. return;
  34. }
  35. Entity entity = (Entity) dependencies.get("entity");
  36. int x = (int) dependencies.get("x");
  37. int y = (int) dependencies.get("y");
  38. int z = (int) dependencies.get("z");
  39. World world = (World) dependencies.get("world");
  40. if ((Math.random() < 0.005)) {
  41. if (!world.isRemote) {
  42. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_redOrb.block, (int) (1)));
  43. entityToSpawn.setPickupDelay(10);
  44. world.spawnEntity(entityToSpawn);
  45. }
  46. }
  47. if ((Math.random() < 0.005)) {
  48. if (!world.isRemote) {
  49. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_orangeOrb.block, (int) (1)));
  50. entityToSpawn.setPickupDelay(10);
  51. world.spawnEntity(entityToSpawn);
  52. }
  53. }
  54. if ((Math.random() < 0.005)) {
  55. if (!world.isRemote) {
  56. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_yellowOrb.block, (int) (1)));
  57. entityToSpawn.setPickupDelay(10);
  58. world.spawnEntity(entityToSpawn);
  59. }
  60. }
  61. if ((Math.random() < 0.005)) {
  62. if (!world.isRemote) {
  63. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_greenOrb.block, (int) (1)));
  64. entityToSpawn.setPickupDelay(10);
  65. world.spawnEntity(entityToSpawn);
  66. }
  67. }
  68. if ((Math.random() < 0.005)) {
  69. if (!world.isRemote) {
  70. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_lightBlueOrb.block, (int) (1)));
  71. entityToSpawn.setPickupDelay(10);
  72. world.spawnEntity(entityToSpawn);
  73. }
  74. }
  75. if ((Math.random() < 0.005)) {
  76. if (!world.isRemote) {
  77. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_blueOrb.block, (int) (1)));
  78. entityToSpawn.setPickupDelay(10);
  79. world.spawnEntity(entityToSpawn);
  80. }
  81. }
  82. if ((Math.random() < 0.005)) {
  83. if (!world.isRemote) {
  84. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_purpleOrb.block, (int) (1)));
  85. entityToSpawn.setPickupDelay(10);
  86. world.spawnEntity(entityToSpawn);
  87. }
  88. }
  89. if (((entity instanceof EntityLivingBase)
  90. ? ((EntityPlayer) entity).inventory.hasItemStack(new ItemStack(mcreator_orbRadar.block, (int) (1)))
  91. : false)) {
  92. if ((Math.random() < 0.01)) {
  93. if (!world.isRemote) {
  94. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_redOrb.block, (int) (1)));
  95. entityToSpawn.setPickupDelay(10);
  96. world.spawnEntity(entityToSpawn);
  97. }
  98. }
  99. if ((Math.random() < 0.01)) {
  100. if (!world.isRemote) {
  101. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_orangeOrb.block, (int) (1)));
  102. entityToSpawn.setPickupDelay(10);
  103. world.spawnEntity(entityToSpawn);
  104. }
  105. }
  106. if ((Math.random() < 0.01)) {
  107. if (!world.isRemote) {
  108. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_yellowOrb.block, (int) (1)));
  109. entityToSpawn.setPickupDelay(10);
  110. world.spawnEntity(entityToSpawn);
  111. }
  112. }
  113. if ((Math.random() < 0.01)) {
  114. if (!world.isRemote) {
  115. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_greenOrb.block, (int) (1)));
  116. entityToSpawn.setPickupDelay(10);
  117. world.spawnEntity(entityToSpawn);
  118. }
  119. }
  120. if ((Math.random() < 0.01)) {
  121. if (!world.isRemote) {
  122. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_lightBlueOrb.block, (int) (1)));
  123. entityToSpawn.setPickupDelay(10);
  124. world.spawnEntity(entityToSpawn);
  125. }
  126. }
  127. if ((Math.random() < 0.01)) {
  128. if (!world.isRemote) {
  129. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_blueOrb.block, (int) (1)));
  130. entityToSpawn.setPickupDelay(10);
  131. world.spawnEntity(entityToSpawn);
  132. }
  133. }
  134. if ((Math.random() < 0.01)) {
  135. if (!world.isRemote) {
  136. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_purpleOrb.block, (int) (1)));
  137. entityToSpawn.setPickupDelay(10);
  138. world.spawnEntity(entityToSpawn);
  139. }
  140. }
  141. }
  142. if (((entity instanceof EntityLivingBase) ? ((EntityPlayer) entity).inventory.hasItemStack(new ItemStack(mcreator_orbRadarCosmos.block,
  143. (int) (1))) : false)) {
  144. if ((Math.random() < 0.05)) {
  145. if (!world.isRemote) {
  146. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_redOrb.block, (int) (1)));
  147. entityToSpawn.setPickupDelay(10);
  148. world.spawnEntity(entityToSpawn);
  149. }
  150. }
  151. if ((Math.random() < 0.05)) {
  152. if (!world.isRemote) {
  153. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_orangeOrb.block, (int) (1)));
  154. entityToSpawn.setPickupDelay(10);
  155. world.spawnEntity(entityToSpawn);
  156. }
  157. }
  158. if ((Math.random() < 0.05)) {
  159. if (!world.isRemote) {
  160. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_yellowOrb.block, (int) (1)));
  161. entityToSpawn.setPickupDelay(10);
  162. world.spawnEntity(entityToSpawn);
  163. }
  164. }
  165. if ((Math.random() < 0.05)) {
  166. if (!world.isRemote) {
  167. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_greenOrb.block, (int) (1)));
  168. entityToSpawn.setPickupDelay(10);
  169. world.spawnEntity(entityToSpawn);
  170. }
  171. }
  172. if ((Math.random() < 0.05)) {
  173. if (!world.isRemote) {
  174. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_lightBlueOrb.block, (int) (1)));
  175. entityToSpawn.setPickupDelay(10);
  176. world.spawnEntity(entityToSpawn);
  177. }
  178. }
  179. if ((Math.random() < 0.05)) {
  180. if (!world.isRemote) {
  181. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_blueOrb.block, (int) (1)));
  182. entityToSpawn.setPickupDelay(10);
  183. world.spawnEntity(entityToSpawn);
  184. }
  185. }
  186. if ((Math.random() < 0.05)) {
  187. if (!world.isRemote) {
  188. EntityItem entityToSpawn = new EntityItem(world, x, y, z, new ItemStack(mcreator_purpleOrb.block, (int) (1)));
  189. entityToSpawn.setPickupDelay(10);
  190. world.spawnEntity(entityToSpawn);
  191. }
  192. }
  193. }
  194. }
  195. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement