Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab5e7a9161 | ||
|
|
fba8a72fb2 | ||
|
|
c85f5ac90d | ||
|
|
cff970885d | ||
|
|
94d2845077 | ||
|
|
cfd0de04d7 | ||
|
|
7873dcc16b | ||
|
|
85ac3a0355 |
No files matched your search
@@ -1,9 +1,9 @@
|
|||||||
# Advanced Kill
|
# Advanced Kill
|
||||||
|
|
||||||
Minecraft Plugin to kill players with many possibilities
|
Minecraft Plugin to kill players with many possibilities.
|
||||||
|
|
||||||
The /kill Command is a littelbit borring, isn't it? But, there is the AdvancedKill plugin!
|
The /kill Command is a littel bit 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.
|
You can kill players with many different methods, for example with an explosion or a lightning.
|
||||||
|
|
||||||
## Methods:
|
## Methods:
|
||||||
- anvil - place an anvil above
|
- anvil - place an anvil above
|
||||||
@@ -24,3 +24,27 @@ You can kill players with many different method, for example with an explosion o
|
|||||||
1. Download **AdvancedKill_Paper_x.xx.jar** and copy it into the *plugins* directory from your server.
|
1. Download **AdvancedKill_Paper_x.xx.jar** and copy it into the *plugins* directory from your server.
|
||||||
|
|
||||||
2. Restart the server
|
2. Restart the server
|
||||||
|
|
||||||
|
## Filter
|
||||||
|
The AdvancedKill Plugin has a filter for players. If a player is added to the filter, nobody can kill him with akill.
|
||||||
|
|
||||||
|
### Add a player
|
||||||
|
To add a player, run
|
||||||
|
```
|
||||||
|
/afilter <player>
|
||||||
|
```
|
||||||
|
### Remove a player
|
||||||
|
To remoce a player, run
|
||||||
|
```
|
||||||
|
/afilter <player>
|
||||||
|
```
|
||||||
|
|
||||||
|
### List players
|
||||||
|
To list all players in the filter, run
|
||||||
|
```
|
||||||
|
/afiler
|
||||||
|
```
|
||||||
|
|
||||||
|
### Turn filter on and off
|
||||||
|
To turn the filter on and off, open `config.yml`. You can find the config.yml in `plugins/AdvancedKill`
|
||||||
|
Open it and set `filter-player` to `true` or `false`
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>de.marc.advancedKill</groupId>
|
||||||
|
<artifactId>AdvancedKill</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>AdvancedKill</name>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>21</java.version>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<defaultGoal>clean package</defaultGoal>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.13.0</version>
|
||||||
|
<configuration>
|
||||||
|
<source>${java.version}</source>
|
||||||
|
<target>${java.version}</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.5.3</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>papermc-repo</id>
|
||||||
|
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.papermc.paper</groupId>
|
||||||
|
<artifactId>paper-api</artifactId>
|
||||||
|
<version>1.21.11-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public final class AdvancedKill extends JavaPlugin {
|
public final class AdvancedKill extends JavaPlugin {
|
||||||
|
public static List<String> methods;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
@@ -19,10 +20,20 @@ public final class AdvancedKill extends JavaPlugin {
|
|||||||
saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
|
|
||||||
getCommand("akill").setExecutor(this);
|
getCommand("akill").setExecutor(this);
|
||||||
|
|
||||||
if (getConfig().getBoolean("filter-player")) {
|
|
||||||
getCommand("afilter").setExecutor(new AdvancedKillFilter(this));
|
getCommand("afilter").setExecutor(new AdvancedKillFilter(this));
|
||||||
}
|
|
||||||
|
List<String> methods = new ArrayList<>();
|
||||||
|
|
||||||
|
methods.add("lightning");
|
||||||
|
methods.add("void");
|
||||||
|
methods.add("zombie");
|
||||||
|
methods.add("half");
|
||||||
|
methods.add("anvil");
|
||||||
|
methods.add("explosion");
|
||||||
|
methods.add("fall");
|
||||||
|
methods.add("lava");
|
||||||
|
|
||||||
|
this.methods = methods;
|
||||||
|
|
||||||
getLogger().info("AdvancedKill was loaded!");
|
getLogger().info("AdvancedKill was loaded!");
|
||||||
}
|
}
|
||||||
@@ -42,8 +53,7 @@ public final class AdvancedKill extends JavaPlugin {
|
|||||||
|
|
||||||
//Check Args
|
//Check Args
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
sender.sendMessage("§aMethods:\nlightning\nanvil\nzombie\nvoid\nhalf\nexplosion\nfall\nlava");
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
@@ -62,6 +72,7 @@ public final class AdvancedKill extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Check filter
|
//Check filter
|
||||||
|
if (getConfig().getBoolean("filter-player")) {
|
||||||
List<String> filter = getConfig().getStringList("bypass-players");
|
List<String> filter = getConfig().getStringList("bypass-players");
|
||||||
|
|
||||||
String uuid = target.getUniqueId().toString();
|
String uuid = target.getUniqueId().toString();
|
||||||
@@ -70,6 +81,9 @@ public final class AdvancedKill extends JavaPlugin {
|
|||||||
sender.sendMessage("§cYou can not kill this player!");
|
sender.sendMessage("§cYou can not kill this player!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Run Commands
|
//Run Commands
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
|||||||
@@ -21,6 +21,20 @@ public class AdvancedKillFilter implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(plugin.getConfig().getBoolean("filter-player"))) {
|
||||||
|
sender.sendMessage("§cThe filter is not aktive.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> players = plugin.getConfig().getStringList("bypass-players");
|
||||||
|
|
||||||
|
if (!(args.length == 1)) {
|
||||||
|
sender.sendMessage("No Player defined");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
String msg = "";
|
||||||
|
|
||||||
Player target = Bukkit.getPlayer(args[0]);
|
Player target = Bukkit.getPlayer(args[0]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
@@ -30,10 +44,6 @@ public class AdvancedKillFilter implements CommandExecutor {
|
|||||||
|
|
||||||
String uuid = target.getUniqueId().toString();
|
String uuid = target.getUniqueId().toString();
|
||||||
|
|
||||||
List<String> players = plugin.getConfig().getStringList("bypass-players");
|
|
||||||
|
|
||||||
String msg = "";
|
|
||||||
|
|
||||||
if (players.contains(uuid)) {
|
if (players.contains(uuid)) {
|
||||||
players.remove(uuid);
|
players.remove(uuid);
|
||||||
msg = "§aPlayer was removed successfully!";
|
msg = "§aPlayer was removed successfully!";
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package de.marc.advancedKill;
|
||||||
|
|
||||||
|
import net.kyori.adventure.text.event.ClickEvent;
|
||||||
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
public class AdvancedKillInv {
|
||||||
|
private CommandSender sender;
|
||||||
|
private HashMap<String, Material> blocks;
|
||||||
|
|
||||||
|
public void init(CommandSender sender) {
|
||||||
|
if (!(sender instanceof Player)) {
|
||||||
|
sender.sendMessage("§cTo less args!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.sender = sender;
|
||||||
|
|
||||||
|
HashMap<String, Material> blocks = new HashMap<>();
|
||||||
|
blocks.put("ligthning", Material.LIGHTNING_ROD);
|
||||||
|
blocks.put("half", Material.POTION);
|
||||||
|
blocks.put("zombie", Material.DIAMOND_SWORD);
|
||||||
|
blocks.put("void", Material.BEDROCK);
|
||||||
|
blocks.put("anvil", Material.ANVIL);
|
||||||
|
blocks.put("explosion", Material.TNT);
|
||||||
|
blocks.put("fall", Material.RED_CARPET);
|
||||||
|
blocks.put("lava", Material.LAVA);
|
||||||
|
|
||||||
|
this.blocks = blocks;
|
||||||
|
|
||||||
|
this.open1();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void open1() {
|
||||||
|
Player player = (Player) sender;
|
||||||
|
|
||||||
|
Inventory inv = Bukkit.createInventory(null, 36, MiniMessage.miniMessage().deserialize("<dark_gray>Methods"));
|
||||||
|
|
||||||
|
|
||||||
|
for (String method : AdvancedKill.methods) {
|
||||||
|
ItemStack item = new ItemStack(this.blocks.get(method));
|
||||||
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
|
||||||
|
meta.displayName(MiniMessage.miniMessage().deserialize("<grey>" + method));
|
||||||
|
|
||||||
|
item.setItemMeta(meta);
|
||||||
|
inv.setItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user