add setHearts command for ops

This commit is contained in:
TheTechRobo 2022-03-21 21:29:16 -04:00
parent 76bf3d93f9
commit 4ea21a8d75
3 changed files with 29 additions and 1 deletions

View File

@ -6,4 +6,10 @@ api-version: 1.18
commands:
deletemydata:
description: Deletes your amount of lives, then bans you.
usage: "Usage: Not the way you used it, that's for sure"
usage: "Usage: Not the way you used it, that's for sure"
setHearts:
permission: lifesteal.sethearts
permissions:
lifesteal.sethearts:
default: op

View File

@ -0,0 +1,21 @@
package ca.thetechrobo.smp;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class ExploitAbuse101ByLunarRam implements CommandExecutor {
@Override
public boolean onCommand(CommandSender senderr, Command arg1, String arg2, String[] args) {
if (args.length != 2) {
return false;
}
ScoreboardWrapper tmp = new ScoreboardWrapper();
Player p = Bukkit.getPlayer(args[0]);
Double newHearts = Double.parseDouble(args[1]);
tmp.setHearts(p, newHearts);
return false;
}
}

View File

@ -45,6 +45,7 @@ public class LifestealPlugin extends JavaPlugin {
DeleteMyData dlmydata = new DeleteMyData();
dlmydata.initialise(dl.scores);
this.getCommand("deletemydata").setExecutor(dlmydata);
this.getCommand("setHearts").setExecutor(new ExploitAbuse101ByLunarRam());
addRecipes();
}
@Override