Jump to content

NoobMaster4000

Members
  • Posts

    40
  • Joined

  • Last visited

Everything posted by NoobMaster4000

  1. Testing but I think I've solved. I want that fortune works with autosmelt when mining an iron ore, like it does with the redstone because now it gives me only 1 item
  2. Okay, instead of nuke the drop list I did this: if (!world.isRemote) { for (int i = 0; i < event.getDrops().size(); i++) { if (!event.getDrops().isEmpty() && event.getDrops().get(i).getItem() instanceof ItemBlock) { ItemStack drop = event.getDrops().get(i); Block b = Block.getBlockFromItem(drop.getItem()); ItemStack smelt = FurnaceRecipes.instance() .getSmeltingResult(b.getPickBlock(state, null, world, event.getPos(), player)); smelt.setCount(1 + random.nextInt(fortuneLevel +1)); if (smelt.getItem() instanceof ItemAir) return; if (event.getDrops().contains(drop)) { event.getDrops().remove(drop); } event.getDrops().add(smelt.copy()); } } } Reverted the problem, now telepathy come over autosmelt. Probably my modification is wrong and using ItemHandlerHelper.giveItemToPlayer(player, event.getDrops().get(i)); Now drop both
  3. Maybe I misunderstood or I explained bad, the autosmelt and telepathy enchants works both at the same time, if I harvest a block with a pickaxe with both of them, iron ore block and iron ingot from autosmelt enchant. package com.mod.modcore.events.enchantment; import java.util.Map; import java.util.Random; import com.mod.modcore.config.ConfigHandler; import com.mod.modcore.init.InitEnchants; import com.mod.modcore.lib.PlayerHelper; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemAir; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @EventBusSubscriber public class AutosmeltEvent { static Random random = new Random(); @SubscribeEvent public static void onAutosmeltUse(HarvestDropsEvent event) { EntityPlayer player = (EntityPlayer) event.getHarvester(); if (event.getHarvester() == null) return; ItemStack hand = player.inventory.getCurrentItem(); Map<Enchantment, Integer> autosmelt = EnchantmentHelper.getEnchantments(hand); if (autosmelt.isEmpty() || !autosmelt.containsKey(InitEnchants.AUTOSMELT)) return; Block block = event.getState().getBlock(); IBlockState state = event.getState(); World world = event.getWorld(); @SuppressWarnings("unused") int fortuneLevel = event.getFortuneLevel(); String[] blacklist = ConfigHandler.enchants.autosmelt.blacklistblocks; if (PlayerHelper.isBlacklisted(blacklist, PlayerHelper.getEntityName(block))) { return; } if (!world.isRemote) { ItemStack smelt = FurnaceRecipes.instance() .getSmeltingResult(block.getPickBlock(state, null, world, event.getPos(), player)); for (int i = 0; i < event.getDrops().size(); i++) { if (smelt.getItem() instanceof ItemAir) return; event.getDrops().clear(); event.getDrops().add(smelt.copy()); } } } } I have this now, and works but I don't know how to add the fortunelevel to allow drop more items.
  4. Telepathy: boolean isfull = player.inventory.getFirstEmptyStack() == -1; if (!world.isRemote) { if (telepathylevel > 0) { if (PlayerHelper.isBlacklisted(blacklist, PlayerHelper.getEntityName(block))) return; for (int i = 0; i < event.getDrops().size(); i++) { if (!isfull) { player.inventory.addItemStackToInventory(event.getDrops().get(i)); } else { Random random = new Random(); float f = random.nextFloat() * 0.6F + 0.1F; float f1 = random.nextFloat() * 0.6F + 0.1F; float f2 = random.nextFloat() * 0.6F + 0.1F; float f3 = 0.025F; EntityItem eitem = new EntityItem(world, pos.getX() + f, pos.getY() + f1, pos.getZ() + f2, event.getDrops().get(i).copy()); eitem.motionX = (random.nextGaussian() * f3); eitem.motionY = (random.nextGaussian() * f3 + 0.20000000298023224D); eitem.motionZ = (random.nextGaussian() * f3); world.spawnEntity(eitem); event.setDropChance(0.0F); } } } } Autosmelt: @SubscribeEvent public static void onAutosmeltUse(HarvestDropsEvent event) { EntityPlayer player = (EntityPlayer) event.getHarvester(); if (event.getHarvester() == null) return; ItemStack hand = player.inventory.getCurrentItem(); Map<Enchantment, Integer> autosmelt = EnchantmentHelper.getEnchantments(hand); if (autosmelt.isEmpty() || !autosmelt.containsKey(InitEnchants.AUTOSMELT)) return; Block block = event.getState().getBlock(); IBlockState state = event.getState(); World world = event.getWorld(); int fortuneLevel = event.getFortuneLevel(); String[] blacklist = ConfigHandler.enchants.autosmelt.blacklistblocks; if (PlayerHelper.isBlacklisted(blacklist, PlayerHelper.getEntityName(block))) { return; } if (!world.isRemote) { ItemStack smelt = FurnaceRecipes.instance().getSmeltingResult( new ItemStack(block, 1 + random.nextInt(fortuneLevel + 1), block.getMetaFromState(state))); for (int i = 0; i < event.getDrops().size(); i++) { if (smelt.getItem() instanceof ItemAir) return; event.getDrops().clear(); event.getDrops().add(smelt.copy()); } } } The error log is for this: @SubscribeEvent public static void onExcavateUse(BlockEvent.BreakEvent event) { EntityPlayer player = (EntityPlayer) event.getPlayer(); ItemStack hand = player.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND); Map<Enchantment, Integer> excavate = EnchantmentHelper.getEnchantments(hand); if (excavate.isEmpty() || !excavate.containsKey(InitEnchants.EXCAVATE)) return; int excavatelevel = excavate.get(InitEnchants.EXCAVATE); World world = event.getWorld(); BlockPos pos = event.getPos(); IBlockState state = event.getState(); Block block = event.getState().getBlock(); String[] blacklist = ConfigHandler.enchants.excavate.blacklistblocks; boolean breakonlysimilarblocks = ConfigHandler.enchants.excavate.breakonlysimilarblocks; if (!world.isRemote) { if (excavatelevel > 0) { for (int i = 0; i < (excavatelevel + 1); i++) { Iterable<BlockPos> it = BlockPos.getAllInBox(pos.add(-i, -i, -i), pos.add(i, i, i)); for (BlockPos offset2 : it) { Block block2 = world.getBlockState(offset2).getBlock(); if (!PlayerHelper.isBlacklisted(blacklist, PlayerHelper.getEntityName(block2))) { block2.harvestBlock(world, player, offset2, state, null, ItemStack.EMPTY); block2.removedByPlayer(state, world, offset2, player, true); hand.damageItem(1, player); } else if (breakonlysimilarblocks) { if (block2 == block && !PlayerHelper.isBlacklisted(blacklist, PlayerHelper.getEntityName(block2))) { block2.harvestBlock(world, player, offset2, state, null, ItemStack.EMPTY); block2.removedByPlayer(state, world, offset2, player, true); hand.damageItem(1, player); } } } } } } } With error at line: block2.harvestBlock(world, player, offset2, state, null, ItemStack.EMPTY);
  5. [19:13:28] [Server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.world.BlockEvent$BreakEvent@53c6a690: java.lang.IllegalArgumentException: Cannot get property PropertyEnum{name=variant, clazz=class net.minecraft.block.BlockStone$EnumType, values=[stone, granite, smooth_granite, diorite, smooth_diorite, andesite, smooth_andesite]} as it does not exist in BlockStateContainer{block=minecraft:iron_ore, properties=[]} at net.minecraft.block.state.BlockStateContainer$StateImplementation.getValue(BlockStateContainer.java:204) ~[BlockStateContainer$StateImplementation.class:?] at net.minecraft.block.BlockStone.getItemDropped(BlockStone.java:52) ~[BlockStone.class:?] at net.minecraft.block.Block.getDrops(Block.java:1563) ~[Block.class:?] at net.minecraft.block.Block.getDrops(Block.java:1543) ~[Block.class:?] at net.minecraft.block.Block.dropBlockAsItemWithChance(Block.java:720) ~[Block.class:?] at net.minecraft.block.Block.dropBlockAsItem(Block.java:710) ~[Block.class:?] at net.minecraft.block.Block.harvestBlock(Block.java:929) ~[Block.class:?] at com.mod.modcore.events.enchantment.ExcavateEvent.onExcavateUse(ExcavateEvent.java:48) ~[ExcavateEvent.class:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_20_ExcavateEvent_onExcavateUse_BreakEvent.invoke(.dynamic) ~[?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?] at net.minecraftforge.common.ForgeHooks.onBlockBreakEvent(ForgeHooks.java:838) [ForgeHooks.class:?] at net.minecraft.server.management.PlayerInteractionManager.tryHarvestBlock(PlayerInteractionManager.java:309) [PlayerInteractionManager.class:?] at net.minecraft.server.management.PlayerInteractionManager.blockRemoving(PlayerInteractionManager.java:261) [PlayerInteractionManager.class:?] at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:732) [NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.CPacketPlayerDigging.processPacket(CPacketPlayerDigging.java:56) [CPacketPlayerDigging.class:?] at net.minecraft.network.play.client.CPacketPlayerDigging.processPacket(CPacketPlayerDigging.java:12) [CPacketPlayerDigging.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) [PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_221] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_221] at net.minecraft.util.Util.runTask(Util.java:53) [Util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:798) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) [IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_221] if (!PlayerHelper.isBlacklisted(blacklist, PlayerHelper.getEntityName(block2))) { block2.harvestBlock(world, player, offset2, state, null, ItemStack.EMPTY); block2.removedByPlayer(state, world, offset2, player, true); hand.damageItem(1, player); } The error is at block2.harvestBlock Also, telepathy add the item in my inventory and autosmelt on the ground Telepathy: boolean isfull = player.inventory.getFirstEmptyStack() == -1; if (!isfull) { player.inventory.addItemStackToInventory(event.getDrops().get(i)); } AutoSmelt: if (!world.isRemote) { ItemStack smelt = FurnaceRecipes.instance().getSmeltingResult( new ItemStack(block, 1 + random.nextInt(fortuneLevel + 1), block.getMetaFromState(state))); for (int i = 0; i < event.getDrops().size(); i++) { if (smelt.getItem() instanceof ItemAir) return; event.getDrops().clear(); event.getDrops().add(smelt.copy()); } }
  6. No, I mean how I put it in my entity check? What I need is exclude the player from the blacklist, he should be always whitelisted so that means: Blacklist: cow I hit the cow, no effects. hit the player, effects Blacklist: {} I hit the cow, effects. hit the player, effects The blacklist should always exclude the player making him always affected, even if blacklisted somehow
  7. I know they are not registered with the entity registry, I just don't know how to do it
  8. Sorry, it says "excavatelevel" but: public static void onExcavateUse(BlockEvent.BreakEvent event) { EntityPlayer player = (EntityPlayer) event.getPlayer(); ItemStack hand = player.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND); Map<Enchantment, Integer> excavate = EnchantmentHelper.getEnchantments(hand); if (excavate.isEmpty() || !excavate.containsKey(InitEnchants.EXCAVATE)) return; int excavatelevel = excavate.get(InitEnchants.EXCAVATE); World world = event.getWorld(); BlockPos pos = event.getPos(); IBlockState state = event.getState(); Block block = event.getState().getBlock(); String[] blacklist = ConfigHandler.enchants.excavate.blacklistblocks; boolean breakonlysimilarblocks = ConfigHandler.enchants.excavate.breakonlysimilarblocks; if (!world.isRemote) { if (excavatelevel > 0) { for (int i = 0; i < (excavatelevel + 1); i++) { Iterable<BlockPos> it = BlockPos.getAllInBox(pos.add(-i, -i, -i), pos.add(i, i, i)); for (BlockPos offset2 : it) { Block block2 = world.getBlockState(offset2).getBlock(); if (/* block2 == block && */ block2 != Blocks.AIR && !PlayerHelper.isBlacklisted(blacklist, PlayerHelper.getEntityName(block2))) { block2.harvestBlock(world, player, offset2, state, null, ItemStack.EMPTY); block2.removedByPlayer(state, world, offset2, player, true); hand.damageItem(1, player); } else if (breakonlysimilarblocks) { if (block2 == block && block2 != Blocks.AIR && !PlayerHelper.isBlacklisted(blacklist, PlayerHelper.getEntityName(block2))) { block2.harvestBlock(world, player, offset2, state, null, ItemStack.EMPTY); block2.removedByPlayer(state, world, offset2, player, true); hand.damageItem(1, player); } } } } } } } It works with everything (need the last test) Now the problem is LivingHurtEvent: String[] blacklist = ConfigHandler.enchants.poison.blacklistentities; if (PlayerHelper.isBlacklisted(blacklist, PlayerHelper.getEntityName(entityhurt))) return; The 2 methods are: public static boolean isBlacklisted(String[] blacklist, String name) { for (int i = 0; i < blacklist.length; i++) { if (blacklist[i].contains(name)) { return true; } } return false; } public static String getEntityName(Entity entity) { return EntityList.getKey(entity).toString(); } public static String getEntityName(Block block) { return block.getRegistryName().toString(); } public static String getEntityName(Item item) { return item.getRegistryName().toString(); } Which works if I hit a cow and the effect work, if I add "minecraft:cow" in the blacklist it work and the effect doesn't work on the cow but but I can't add "minecraft:player", if I hit a player it crashes. I want this blacklist so the entities blacklisted aren't affected
  9. if (!world.isRemote) { if (excavatelevel > 0) { for (int i = 0; i < (excavatelevel + 1); i++) { Iterable<BlockPos> it = BlockPos.getAllInBox(pos.add(-i, -i, -i), pos.add(i, i, i)); for (BlockPos offset2 : it) { Block block2 = world.getBlockState(offset2).getBlock(); if (/*block2 == block &&*/ block2 != Blocks.AIR && !PlayerHelper.isBlacklisted(blacklist, block2.getRegistryName().toString())) { block2.harvestBlock(world, player, offset2, state, null, ItemStack.EMPTY); block2.removedByPlayer(state, world, offset2, player, true); hand.damageItem(1, player); } } } } } The comment is because I want to set a setting to break only the same block but I have to solve the problem with the redstone since it becore lit_redstone_ore, so I leave there for now Found this ItemStack hand = player.inventory.armorInventory.get(i); Now telepathy doesn't work with autosmelt, which is: Dropping iron ingots and the ore
  10. Okay, I'll try. I use this: for (int i = 0; i < entityhurt.inventory.armorInventory.size(); i++) { ItemStack hand = player.inventory.armorItemInSlot(i); to check the player armor (for telepathy) but on server it crashes because there's no method, how can I check it? I want to make telepathy compatible for pickaxe/armor
  11. Is just a test, I'll add now what it miss public static void onExcavateUse(BlockEvent.BreakEvent event) { EntityPlayer player = (EntityPlayer) event.getPlayer(); ItemStack hand = player.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND); Map<Enchantment, Integer> excavate = EnchantmentHelper.getEnchantments(hand); if (excavate.isEmpty() || !excavate.containsKey(InitEnchants.EXCAVATE)) return; int excavatelevel = excavate.get(InitEnchants.EXCAVATE); World world = event.getWorld(); BlockPos pos = event.getPos(); Block block = event.getState().getBlock(); String[] blacklist = ConfigHandler.enchants.excavate.blacklistblocks; if (!world.isRemote) { if (excavatelevel > 0) { for (int i = 0; i < (excavatelevel + 1); i++) { Iterable<BlockPos> it = BlockPos.getAllInBox(pos.add(-i, -i, -i), pos.add(i, i, i)); for (BlockPos offset2 : it) { Block block2 = world.getBlockState(offset2).getBlock(); if (block2 == block && block2 != Blocks.AIR && !PlayerHelper.isBlacklisted(blacklist, block2.getRegistryName().toString())) { world.destroyBlock(offset2, true); hand.damageItem(1, player); } } } } } }
  12. public static void onTelepathyUse(HarvestDropsEvent event) { EntityPlayer player = (EntityPlayer) event.getHarvester(); if (event.getHarvester() == null) return; World world = event.getWorld(); ItemStack hand = player.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND); Map<Enchantment, Integer> telepathy = EnchantmentHelper.getEnchantments(hand); if (telepathy.isEmpty() || !telepathy.containsKey(InitEnchants.TELEPATHY)) return; int telepathylevel = telepathy.get(InitEnchants.TELEPATHY); // IBlockState state = event.getState(); // Random random = new Random(); // BlockPos pos = event.getPos(); Block block = event.getState().getBlock(); // int fortuneLevel = event.getFortuneLevel(); // ItemStack drop = new ItemStack(block, 1, block.getMetaFromState(state)); String[] blacklist = ConfigHandler.enchants.telepathy.blacklistblocks; boolean isfull = player.inventory.getFirstEmptyStack() == -1; if (!world.isRemote) { if (telepathylevel > 0) { if (PlayerHelper.isBlacklisted(blacklist, PlayerHelper.getEntityName(block))) return; if (!isfull) { for (int i = 0; i < event.getDrops().size(); i++) { player.inventory.addItemStackToInventory(event.getDrops().get(i)); } } } } } } Like this? Yes, it works not with the 3x3 enchant but it works
  13. It's probably the worst method ever but I have a class for every event so the 2 I've posted are in 2 different classes
  14. I've posted the 2 codes, the enchant that break a 3x3x3 was an example
  15. Oh wow, I'm a idiot!! I use the HarvestDropsEvent ? ? ? ? Did you read what I said in my first comment? No, I guess
  16. I make you an example with 2 other enchants I have: I have an enchant that breaks an area 3x3x3 dropping the item broken (or the basic block if I break stone for example), a second enchant that "teleport" the drop to your inventory and those doesn't work together
  17. Sorry, the 2nd code uses LivingExperienceDropEvent Anyway, the code of both events works alone is when I set 2 enchants that do the same thing that doesn't work. Eg: if I have the 1st code enchant and I apply add the enchant that let me mine 3x3 it doesn't work
  18. EntityPlayer player = (EntityPlayer) event.getHarvester(); if (event.getHarvester() == null) return; World world = event.getWorld(); ItemStack hand = player.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND); Map<Enchantment, Integer> telepathy = EnchantmentHelper.getEnchantments(hand); if (telepathy.isEmpty() || !telepathy.containsKey(InitEnchants.TELEPATHY)) return; int telepathylevel = telepathy.get(InitEnchants.TELEPATHY); IBlockState state = event.getState(); Random random = new Random(); BlockPos pos = event.getPos(); Block block = event.getState().getBlock(); Messages.sendMessage(player, block.toString()); int fortuneLevel = event.getFortuneLevel(); ItemStack drop = new ItemStack(block, 1, block.getMetaFromState(state)); String[] blacklist = ConfigHandler.enchants.telepathy.blacklistblocks; boolean isfull = player.inventory.getFirstEmptyStack() == -1; if (!world.isRemote) { if (telepathylevel > 0) { if (PlayerHelper.isBlacklisted(blacklist, PlayerHelper.getEntityName(block))) return; event.getDrops().clear(); if (drop.getItem() instanceof ItemAir) return; if ((drop != null) && (!(drop.getItem() instanceof ItemAir))) { int nItems = 0; if ((fortuneLevel > 0) && (!(drop.getItem() instanceof ItemBlock))) { nItems = event.getDrops().size() + random.nextInt(fortuneLevel + 1); } else if ((fortuneLevel <= 0) && (!(drop.getItem() instanceof ItemBlock))) { nItems = event.getDrops().size(); } if ((drop.getItem() instanceof ItemBlock)) { nItems = 1; } for (int i = 0; i < nItems; i++) { if (!isfull) { player.inventory.addItemStackToInventory(drop.copy()); } else { float f = random.nextFloat() * 0.6F + 0.1F; float f1 = random.nextFloat() * 0.6F + 0.1F; float f2 = random.nextFloat() * 0.6F + 0.1F; float f3 = 0.025F; EntityItem eitem = new EntityItem(world, pos.getX() + f, pos.getY() + f1, pos.getZ() + f2, drop.copy()); eitem.motionX = (random.nextGaussian() * f3); eitem.motionY = (random.nextGaussian() * f3 + 0.20000000298023224D); eitem.motionZ = (random.nextGaussian() * f3); world.spawnEntity(eitem); event.setDropChance(0.0F); } } } } } } if (event.getAttackingPlayer() instanceof EntityPlayer) { if (event.getEntityLiving() instanceof EntityLivingBase) { EntityLivingBase entity = (EntityLivingBase) event.getEntityLiving(); World world = entity.world; if (!world.isRemote) { EntityPlayer player = (EntityPlayer) event.getAttackingPlayer(); ItemStack head = player.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND); Map<Enchantment, Integer> xpboost = EnchantmentHelper.getEnchantments(head); if (xpboost.isEmpty() || !xpboost.containsKey(InitEnchants.XP_BOOST)) return; int xpboostlevel = xpboost.get(InitEnchants.XP_BOOST); int xp = event.getDroppedExperience(); int xpboostxlevel = xpboostlevel; while (xp > 0) { int cap = EntityXPOrb.getXPSplit(xp) + xpboostxlevel; xp -= cap; entity.world.spawnEntity(new EntityXPOrb(world, entity.posX, entity.posY, entity.posZ, cap)); } } } } I want to make these compatible
  19. How can I make my enchants compatible with other my enchants? I'm not talking about @Override protected boolean canApplyTogether(Enchantment ench) { return super.canApplyTogether(ench) && (ench != Enchantments.SILK_TOUCH); } but like: I have an enchant that uses HarvestDropsEvent and add the drop to your inventory but when I add another enchant that uses the same Event or a drop event it throws a NPE on ItemStack hand = player.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND); How can I make it compatible so that when I mine if I have the enchant A it adds my drops to my inventory if I have B it drops me more exp but when my pickaxe has both the enchants it drops me more exp and set the drop into my inventory?
  20. Oh sorry, I had the suppress warning and I didn't notice it
  21. I need it to add some potion effects to a potion itemstack for a little block that drops few items when broken for a minigame I'm creating. if this is wrong how can I add it?
  22. Hello, I'm trying to spawn a Potion EntityItem with EntityItem potion1 = new EntityItem(worldIn, pos.getX(), pos.getY(), pos.getZ(), new PotionUtils().addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.WATER)); worldIn.spawnEntity(potion1); But every time I perform the action that should drop me the potion I get this error: [16:16:52] [Server thread/FATAL] [net.minecraft.server.MinecraftServer]: Error executing task java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: net.minecraft.potion.PotionUtils: method <init>()V not found at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_222] at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_222] at net.minecraft.util.Util.func_181617_a(SourceFile:47) [h.class:?] at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:723) [MinecraftServer.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:397) [nz.class:?] at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222] Caused by: java.lang.NoSuchMethodError: net.minecraft.potion.PotionUtils: method <init>()V not found at com.environment.randomdrops.events.RandomDrops.Drops(RandomDrops.java:512) ~[RandomDrops.class:?] at net.minecraft.block.Block.removedByPlayer(Block.java:1178) ~[aow.class:?] at net.minecraft.server.management.PlayerInteractionManager.removeBlock(PlayerInteractionManager.java:271) ~[or.class:?] at net.minecraft.server.management.PlayerInteractionManager.func_180237_b(PlayerInteractionManager.java:324) ~[or.class:?] at net.minecraft.server.management.PlayerInteractionManager.func_180785_a(PlayerInteractionManager.java:244) ~[or.class:?] at net.minecraft.network.NetHandlerPlayServer.func_147345_a(NetHandlerPlayServer.java:704) ~[pa.class:?] at net.minecraft.network.play.client.CPacketPlayerDigging.func_148833_a(SourceFile:40) ~[lp.class:?] at net.minecraft.network.play.client.CPacketPlayerDigging.func_148833_a(SourceFile:10) ~[lp.class:?] at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) ~[hv$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_222] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_222] at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?] ... 5 more The if (!entity.world.isRemote) exists already
  23. getEntityAttribute has nothing to do with NBT. I need both, and both are my problem, that's why I said Attribute/NBT I'll try it now Do not create new Random instances all the time. What can I do then?
×
×
  • Create New...

Important Information

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