Posted May 29, 20214 yr Hi, I am trying to spawn a splash potion with a specified potion effect (e.g. Slowness) with PotionEntity. I also already have an Potion Object but how do I get the PotionEntity to "have" my Potion or EffectInstance? Thanks in advance PotionEntity potion = new PotionEntity(world, player); potion.setPos(playerPos.getX(), playerPos.getY() + 20, playerPos.getZ()); ItemStack splashPotion = new ItemStack(Items.SPLASH_POTION, 1); EffectInstance potionEffect = new EffectInstance(Effects.BLINDNESS, 500, 100); Potion potionToSet = new Potion(potionEffect); PotionUtils.setPotion(splashPotion, potionToSet); potion.setItem(splashPotion); This is the code I am trying to use, but it only spawns a splash potion without any effects. Edited May 29, 20214 yr by Steverixxi
May 29, 20214 yr 1 hour ago, Steverixxi said: Hi, I am trying to spawn a splash potion with a specified potion effect (e.g. Slowness) with PotionEntity. I also already have an Potion Object but how do I get the PotionEntity to "have" my Potion or EffectInstance? you can't use an effect that has no item if you want to use an effect that doesn't have a potion registered by vanilla, you have to register it yourself you can find all registered potions in the Potions class
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.