Skip to content

Commit 22c7c1e

Browse files
committed
added Zombiekills\src\me\bukkit\MatCeba14\ZombieKills.java
1 parent 16febe4 commit 22c7c1e

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package me.bukkit.MatCeba14;
2+
import org.bukkit.ChatColor;
3+
import org.bukkit.command.Command;
4+
import org.bukkit.command.CommandSender;
5+
import org.bukkit.entity.Player;
6+
import org.bukkit.plugin.java.JavaPlugin;
7+
8+
public class ZombieKills extends JavaPlugin {
9+
10+
@Override
11+
public void onEnable() {
12+
new ZombieListener(this);
13+
14+
this.getConfig().addDefault("zombiekills", 0);
15+
this.getConfig().options().copyDefaults();
16+
saveConfig();
17+
18+
}
19+
20+
@Override
21+
public void onDisable() {
22+
saveConfig();
23+
}
24+
25+
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
26+
27+
if (cmd.getName().equalsIgnoreCase("zombiekills") && sender instanceof Player) {
28+
29+
Player player = (Player) sender;
30+
31+
player.sendMessage(ChatColor.GOLD + "" + this.getConfig().getInt("zombiekills") + ChatColor.GREEN + " zombies " + ChatColor.GOLD + "have been killed!");
32+
33+
return true;
34+
35+
}
36+
37+
return false;
38+
39+
}
40+
41+
}

0 commit comments

Comments
 (0)