package net.paladrill.paladrillmod.procedure; import net.paladrill.paladrillmod.ElementsPaladrillmodMod; import net.minecraft.potion.PotionEffect; import net.minecraft.init.MobEffects; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.Entity; import java.util.Map; @ElementsPaladrillmodMod.ModElement.Tag public class ProcedureHangGliderRightClickedInAir extends ElementsPaladrillmodMod.ModElement { public ProcedureHangGliderRightClickedInAir(ElementsPaladrillmodMod instance) { super(instance, 226); } public static void executeProcedure(Map dependencies) { if (dependencies.get("entity") == null) { System.err.println("Failed to load dependency entity for procedure HangGliderRightClickedInAir!"); return; } Entity entity = (Entity) dependencies.get("entity"); if (entity instanceof EntityLivingBase) ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.LEVITATION, (int) 5, (int) (-4), (false), (false))); if (entity instanceof EntityLivingBase) ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, (int) 1, (int) 5, (false), (false))); } }