Jump to content

MorelPlay

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by MorelPlay

  1. How can I generate a new UUID?
  2. I'm trying to create a potion effect with the resistance knockback attribute but not find the UUID anywhere. Minecraft Attributes page is missing. http://minecraft.gamepedia.com/Attribute Can someone tell me what I can do? public static final CustomPotion KnockbackPotion = (CustomPotion) new CustomPotion(new ResourceLocation(EnergyTools.MODID + ":Knockback"), false, 8171462).setPotionName(EnergyTools.MODID + "potion.KnockbackPotion").registerPotionAttributeModifier(SharedMonsterAttributes.KNOCKBACK_RESISTANCE, "UUID?", 5D, 2);
  3. Hello, I'm having a problem with my code 1.11.2. For some reason it is not working properly and when I break a spawner with silk touch, it gives me the spawner without the entity tag, it always gives me the spawner of pig. This is my code, I would be grateful that someone could help me. Thank you @SubscribeEvent public void onBlockBreak(BlockEvent.BreakEvent e) { IBlockState state = e.getState(); World world = e.getWorld(); BlockPos pos = e.getPos(); EntityPlayer player = e.getPlayer(); ItemStack heldItem = player.getHeldItem(EnumHand.MAIN_HAND); if (state.getBlock() == Blocks.MOB_SPAWNER) { Map<Enchantment, Integer> enchants = EnchantmentHelper.getEnchantments(heldItem); if (enchants.containsKey(Enchantments.SILK_TOUCH)) { ItemStack stack = new ItemStack(Blocks.MOB_SPAWNER, 1, 0); NBTTagCompound nbttagcompound = new NBTTagCompound(); world.getTileEntity(pos).writeToNBT(nbttagcompound); stack.setTagInfo("BlockEntityTag", nbttagcompound); e.setExpToDrop(0); e.getWorld().spawnEntity(new EntityItem(world, pos.getX(), pos.getY(), pos.getZ(), stack)); } } }
×
×
  • Create New...

Important Information

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