Compare commits
19 Commits
8a22c4593f
...
beta2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9814a58ea6 | ||
|
|
6b263e0e8b | ||
|
|
fd092a02cc | ||
|
|
5a09d7b15c | ||
|
|
de8244815a | ||
| f30cb5a4b8 | |||
| 6bcb3f0e39 | |||
| eade17395f | |||
| a2f32ba314 | |||
| 6ba052ec2a | |||
| b3add4888b | |||
| b781aa22e3 | |||
| 03ca70ddfa | |||
| 04048a3d0f | |||
| f49fab6174 | |||
| 989e2accb5 | |||
|
|
95b949a40e | ||
|
|
649d5dd45b | ||
|
|
eaaef626ce |
25
README.md
25
README.md
@@ -1,3 +1,26 @@
|
||||
# Advanced Kill
|
||||
|
||||
Beta
|
||||
Minecraft Plugin to kill players with many possibilities
|
||||
|
||||
The /kill Command is a littelbit borring, isn't it? But, there is the AdvancedKill plugin!
|
||||
You can kill players with many different method, for example with an explosion or a lightning.
|
||||
|
||||
## Methods:
|
||||
- anvil - place an anvil above
|
||||
- fall - teleports the player to high 300
|
||||
- explosion - makes an explosion by the player
|
||||
- lightning - summons a lightning by the player
|
||||
- half - set the health for the player to a half heart
|
||||
- lava - places lava for 3 seconds by the player
|
||||
- void - teleports the player into the void
|
||||
- zombie - spawns a zombie with a diamond sword for 10 seconds by the player
|
||||
|
||||
## Usage
|
||||
```
|
||||
/akill <method> <player>
|
||||
```
|
||||
|
||||
## Installation
|
||||
1. Download **AdvancedKill_Paper_x.xx.jar** and copy it into the *plugins* directory from your server.
|
||||
|
||||
2. Restart the server
|
||||
@@ -5,7 +5,6 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import de.marc.advancedKill.commands.*;
|
||||
|
||||
@@ -17,7 +16,14 @@ public final class AdvancedKill extends JavaPlugin {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
// Plugin startup logic
|
||||
saveDefaultConfig();
|
||||
|
||||
getCommand("akill").setExecutor(this);
|
||||
|
||||
if (getConfig().getBoolean("filter-player")) {
|
||||
getCommand("afilter").setExecutor(new AdvancedKillFilter(this));
|
||||
}
|
||||
|
||||
getLogger().info("AdvancedKill was loaded!");
|
||||
}
|
||||
|
||||
@@ -46,9 +52,7 @@ public final class AdvancedKill extends JavaPlugin {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Define mode et player
|
||||
//Define mode and player
|
||||
String mode = args[0].toLowerCase();
|
||||
Player target = Bukkit.getPlayer(args[1]);
|
||||
|
||||
@@ -57,15 +61,15 @@ public final class AdvancedKill extends JavaPlugin {
|
||||
return true;
|
||||
}
|
||||
|
||||
//Check filter
|
||||
List<String> filter = getConfig().getStringList("bypass-players");
|
||||
|
||||
//Filtering 470Hacker
|
||||
//if (target.getName().equals("470Hacker")) {
|
||||
// if (!sender.hasPermission("akill.admin")) {
|
||||
// sender.sendMessage("§c470Hacker darf nicht gefoltert werden!");
|
||||
// return true;
|
||||
// }
|
||||
//}
|
||||
String uuid = target.getUniqueId().toString();
|
||||
|
||||
if (filter.contains(uuid)) {
|
||||
sender.sendMessage("§cYou can not kill this player!");
|
||||
return true;
|
||||
}
|
||||
|
||||
//Run Commands
|
||||
switch (mode) {
|
||||
@@ -110,24 +114,32 @@ public final class AdvancedKill extends JavaPlugin {
|
||||
|
||||
//Completions
|
||||
@Override
|
||||
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender,
|
||||
@NotNull Command command,
|
||||
@NotNull String alias,
|
||||
String[] args) {
|
||||
public @Nullable List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
|
||||
List<String> completions = new ArrayList<>();
|
||||
if (sender.hasPermission("akill.use")) {
|
||||
if (args.length == 1) {
|
||||
completions.add("lightning");
|
||||
completions.add("void");
|
||||
completions.add("zombie");
|
||||
completions.add("half");
|
||||
completions.add("anvil");
|
||||
completions.add("explosion");
|
||||
completions.add("fall");
|
||||
completions.add("lava");
|
||||
}
|
||||
|
||||
if (args.length == 2) {
|
||||
if (label.equals("akill")) {
|
||||
if (sender.hasPermission("akill.use")) {
|
||||
if (args.length == 1) {
|
||||
completions.add("lightning");
|
||||
completions.add("void");
|
||||
completions.add("zombie");
|
||||
completions.add("half");
|
||||
completions.add("anvil");
|
||||
completions.add("explosion");
|
||||
completions.add("fall");
|
||||
completions.add("lava");
|
||||
}
|
||||
|
||||
if (args.length == 2) {
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
completions.add(player.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (label.equals("afilter")) {
|
||||
if (args.length == 1) {
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
completions.add(player.getName());
|
||||
}
|
||||
@@ -136,4 +148,4 @@ public final class AdvancedKill extends JavaPlugin {
|
||||
|
||||
return completions;
|
||||
}
|
||||
}
|
||||
}
|
||||
52
src/main/java/de/marc/advancedKill/AdvancedKillFilter.java
Normal file
52
src/main/java/de/marc/advancedKill/AdvancedKillFilter.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package de.marc.advancedKill;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AdvancedKillFilter implements CommandExecutor {
|
||||
private AdvancedKill plugin;
|
||||
|
||||
public AdvancedKillFilter(AdvancedKill plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!sender.hasPermission("akill.admin")) {
|
||||
sender.sendMessage("§cPermission denied!");
|
||||
return true;
|
||||
}
|
||||
|
||||
Player target = Bukkit.getPlayer(args[0]);
|
||||
|
||||
if (target == null) {
|
||||
sender.sendMessage("§cPlayer not found!");
|
||||
return true;
|
||||
}
|
||||
|
||||
String uuid = target.getUniqueId().toString();
|
||||
|
||||
List<String> players = plugin.getConfig().getStringList("bypass-players");
|
||||
|
||||
String msg = "";
|
||||
|
||||
if (players.contains(uuid)) {
|
||||
players.remove(uuid);
|
||||
msg = "§aPlayer was removed successfully!";
|
||||
}else{
|
||||
players.add(uuid);
|
||||
msg = "§aPlayer was added successfully!";
|
||||
}
|
||||
|
||||
plugin.getConfig().set("bypass-players", players);
|
||||
plugin.saveConfig();
|
||||
|
||||
sender.sendMessage(msg);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -18,12 +18,7 @@ public class LavaCmd {
|
||||
|
||||
|
||||
public void execute(CommandSender sender, Player target) {
|
||||
Location lava_loc = new Location(
|
||||
target.getLocation().getWorld(),
|
||||
target.getLocation().getX(),
|
||||
target.getLocation().getY() - 1,
|
||||
target.getLocation().getZ()
|
||||
);
|
||||
Location lava_loc = target.getLocation();
|
||||
|
||||
Block block = lava_loc.getBlock();
|
||||
Material old_block = block.getType();
|
||||
|
||||
@@ -21,6 +21,6 @@ public class VoidCmd {
|
||||
0
|
||||
);
|
||||
target.teleport(loc);
|
||||
sender.sendMessage("§aErfolg!");
|
||||
sender.sendMessage("§aSuccess!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package de.marc.advancedKill.commands;
|
||||
|
||||
import de.marc.advancedKill.AdvancedKill;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -24,6 +25,14 @@ public class ZombieCmd {
|
||||
zombie.getEquipment().setItemInMainHand(
|
||||
new ItemStack(Material.DIAMOND_SWORD)
|
||||
);
|
||||
sender.sendMessage("§aErfolg!");
|
||||
|
||||
zombie.setCustomName("akill");
|
||||
zombie.setCustomNameVisible(false);
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(plugin, () -> {
|
||||
zombie.remove();
|
||||
}, 200L);
|
||||
|
||||
sender.sendMessage("§aSuccess!");
|
||||
}
|
||||
}
|
||||
|
||||
8
src/main/resources/config.yml
Normal file
8
src/main/resources/config.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
# Active Filter Function
|
||||
|
||||
filter-player: true
|
||||
|
||||
# To filter player, run /afilter <player> to filter players
|
||||
|
||||
# Filter List
|
||||
bypass-players: []
|
||||
@@ -5,13 +5,17 @@ api-version: '1.21'
|
||||
|
||||
commands:
|
||||
akill:
|
||||
description: aKill Befehl
|
||||
description: aKill Command
|
||||
usage: /akill <mode> <player>
|
||||
|
||||
afilter:
|
||||
description: Filter Players
|
||||
usage: /afilter <player>
|
||||
|
||||
permissions:
|
||||
akill.use:
|
||||
description: Darf /akill benutzen
|
||||
description: Can use /akill
|
||||
default: op
|
||||
akill.admin:
|
||||
description: Darf 470Hacker töten
|
||||
description: Can use /afilter
|
||||
default: op
|
||||
Reference in New Issue
Block a user