So I am making a skript were you can shear the sheep with a player head but I am also trying to make a auto compresser that I cannot figure out how to make it work, I want it to check for 160 white wool and then check to see if they have an item in there inventory and if they do not then the items will not compress. If you need more information you can just ask me.
Code:
on rightclick on sheep with player head:
give player 1 white wool named "&fWhite Wool"
if player has 160 white wool named "&fWhite Wool" in inventory:
remove 160 white wool named "&fWhite Wool" from player's inventory
give 1 white wool of unbreaking 1 named "&9&lCompact Wool" with all flags hidden to player