scoreboard players set @s chicken 0
advancement revoke @s only cf:wildchicken
advancement revoke @s only cf:playerkill
execute store result score .random random run random value 1..3
execute if score .random random = .1 random run scoreboard players add @s feathers 2
execute if score .random random = .2 random run scoreboard players add @s feathers 3
execute if score .random random = .3 random run scoreboard players add @s feathers 4
effect give @s minecraft:glowing infinite 0 true
effect give @s minecraft:slowness infinite 1 true
effect give @s minecraft:weakness infinite 2 true

execute at @s run particle minecraft:end_rod ~ ~1.5 ~ 0.1 0.1 0.1 0.1 10 normal


item replace entity @s armor.head with minecraft:paper[minecraft:custom_data={customTag:69},minecraft:custom_model_data={floats:[2000.0f]},minecraft:custom_name='{"bold":true,"color":"white","italic":false,"text":"Chicken"}']
item replace entity @s[predicate=!cf:offhand] weapon.offhand with minecraft:paper[minecraft:custom_data={customTag:69},minecraft:custom_model_data={floats:[2000.0f]},minecraft:custom_name='{"bold":true,"color":"white","italic":false,"text":"Chicken"}']
title @s times 5t 40t 5t
title @s title {"text":"YOU HAVE A CHICKEN","type":"text"}
title @s subtitle {"text":"return it to your base","type":"text"}
tellraw @a {"text":"","color":"white","extra":[{"selector":"@s","type":"selector"},{"text":" caught a chicken  !","type":"text"}],"type":"text"}
tag @s add chicken