Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.techwiz.penceperkill;
- import net.milkbowl.vault.economy.Economy;
- import net.milkbowl.vault.economy.EconomyResponse;
- import org.bukkit.ChatColor;
- import org.bukkit.entity.LivingEntity;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.entity.EntityDeathEvent;
- import org.bukkit.plugin.java.JavaPlugin;
- public class PencePerKill extends JavaPlugin {
- public static Economy econ = null;
- @EventHandler
- public void onEntityDeathEvent(EntityDeathEvent event) {
- LivingEntity entity = event.getEntity();
- Player killer = entity.getKiller();
- if (killer instanceof Player) {
- EconomyResponse r = econ.depositPlayer(killer, 0.50);
- if (r.transactionSuccess()) {
- killer.sendMessage(ChatColor.GREEN + "Good Job, " + killer.getDisplayName() + "! You killed a " + entity.getName() + "and recieved" + ChatColor.RED + "£0.50");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement