So I have a problem. I'm making a datapack in minecraft 1.19 and I want a way to unban players from the server using it. It's supposed to be done by throwing or using a nether star (unban the player whose the item is named after) the datapack basically bans a player with a certain number of deaths. Also if there's a different, or a better way to do it, please send it here, it will help! Also remember, a different player will unban the banned player, and I need a way to do it without the use of more commands.
1 Answer
/pardon
requires permission level (archive) 3. Functions normally only have permission level 2, but you can define it differently in server.properties
:
function-permission-level=3
Once you set that and restart the server, using /pardon
in functions will just work like you would expect.
If you don't run a dedicated server, you cannot do what you want, at least not without mods (and I don't know a mod that does this). Another way would be using a "server wrapper" that sends commands to the server console, which has permission level 4, but that would likely require you to write custom software for your usecase (and still only works on a dedicated server).
-
No, I know which command unbans the player, I want to make it so a player can unban someone, I dont know how to make it, it can be made by naming the item the name of the player or somehow otherwise. I want the players to get a nether star, so they can use it to unban a player. Sep 15, 2022 at 17:04
-
I'm pretty sure that, if the player isn't on the server (and they can't in this case), then you need to use the exact name in the command, you can't use selectors (because they would never match). So if you want it more general, without hardcoding the names, a server wrapper would be the only way, a datapack couldn't do it. Alternatively, you could just not ban players automatically and instead teleport them to some far place. Sep 16, 2022 at 1:14