package com.acethewildfire.acesbs.util;

import net.fabricmc.fabric.api.event.player.AttackEntityCallback;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.SheepEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;

public class YouMonsterEvent implements AttackEntityCallback {
    @Override
    public ActionResult interact(PlayerEntity player, World world, Hand hand, Entity entity, @Nullable EntityHitResult hitResult) {

        if(entity instanceof SheepEntity && player.getMainHandStack().getItem() == Items.END_ROD && world.isClient()){
            player.sendMessage(Text.literal(player.getName().getLiteralString() + ", YOU SICK FUCKER!"));
        }

        return ActionResult.PASS;
    }
}
