package com.tiedup.remake.items;

import com.tiedup.remake.entities.EntityRopeArrow;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.projectile.AbstractArrow;
import net.minecraft.world.item.ArrowItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;

/**
 * Rope Arrow - Arrow that ties up targets on hit
 * When fired from a bow and hits an entity, it has 75% chance to bind them.
 *
 *
 * Behavior:
 * - Works like regular arrows for firing
 * - On hit: 75% chance to bind the target with rope
 * - Target must be IRestrainable (Player, Damsel, Kidnapper)
 */
public class ItemRopeArrow extends ArrowItem {

    public ItemRopeArrow() {
        super(new Properties().stacksTo(64));
    }

    /**
     * Create the arrow entity when fired from a bow.
     * Returns EntityRopeArrow for special binding behavior on hit.
     *
     * @param level The world
     * @param stack The arrow item stack
     * @param shooter The entity firing the bow
     * @return EntityRopeArrow instance
     */
    @Override
    public AbstractArrow createArrow(
        Level level,
        ItemStack stack,
        LivingEntity shooter
    ) {
        return new EntityRopeArrow(level, shooter);
    }
}
