Ban player using datapack

I want to create an advancement that bans the player that achieved it, by being hit with an item called ban hammer. the advancement itself works, but the ban command doesnt. you might think that is because I have to increase the function-permission-level in the server.properties to at least 3, which I did, and it still doesnt work. I also tried removing op from the player who got hit by the ban hammer, and it just doesnt work. running a test command like say a does work, but the ban doesnt. why and how do I fix that? this is the advancement.json { "criteria": { "hit_by_ban_hammer": { "trigger": "minecraft:entity_hurt_player", "conditions": { "damage": { "type": { "source_entity": { "type": "minecraft:player", "equipment": { "mainhand": { "items": "minecraft:mace", "components": { "minecraft:custom_model_data": 31040008 } } } } } } } } }, "rewards": { "function": "skyquest:system/item/ban_hammer" } } and this is the ban_hammer.mcfunction: ban @s note: this all happens on a 1.21 localhost server, idk if that makes a difference (i dont think so but who knows)
Continue to help post