package net.mcreator.puzzle_code.procedures;

import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Entity;

import net.mcreator.puzzle_code.network.PuzzleCodeModVariables;
import net.mcreator.puzzle_code.init.PuzzleCodeModMobEffects;

public class YellowSwicherPotionPotionStartedappliedProcedure {
	public static void execute(Entity entity) {
		if (entity == null)
			return;
		if (entity instanceof Player) {
			{
				PuzzleCodeModVariables.PlayerVariables _vars = entity.getData(PuzzleCodeModVariables.PLAYER_VARIABLES);
				_vars.YellowSwitcherEffectPower = entity instanceof LivingEntity _livEnt && _livEnt.hasEffect(PuzzleCodeModMobEffects.YELLOW_SWITCHER_EFFECT) ? _livEnt.getEffect(PuzzleCodeModMobEffects.YELLOW_SWITCHER_EFFECT).getAmplifier() : 0;
				_vars.syncPlayerVariables(entity);
			}
			{
				PuzzleCodeModVariables.PlayerVariables _vars = entity.getData(PuzzleCodeModVariables.PLAYER_VARIABLES);
				_vars.IsSwitchedYellow = true;
				_vars.syncPlayerVariables(entity);
			}
		}
	}
}
