Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Pets extends JavaPlugin implements Listener {
- @SuppressWarnings("unused")
- private static final String LivingEntity = null;
- private HashMap<UUID, Guardian> G = new HashMap<UUID,Guardian>();
- @EventHandler
- public void OnLeave(PlayerQuitEvent event){
- Player player = (Player) event.getPlayer();
- player.chat("/wh kill");
- }
- @EventHandler
- public void OnKick(PlayerKickEvent event){
- Player player = (Player) event.getPlayer();
- player.chat("/wh kill");
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- Player player = (Player) sender;
- if (cmd.getName().equalsIgnoreCase("pet") && sender instanceof Player) {
- }
- if (args.length == 0) {
- //insert wut ever here
- }
- if(args[0].equalsIgnoreCase("guardiansummon")) {
- Guardian guard = player.getLocation().getWorld().spawn(player.getLocation().add(2, 0, 0), Guardian.class);
- G.put(player.getUniqueId(),guard);
- G.get(player.getUniqueId()).addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 1000000000 , 1000000000));
- G.get(player.getUniqueId()).addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 1000000000 , 1000000000));
- G.get(player.getUniqueId()).addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 1000000000 , 1000000000));
- G.get(player.getUniqueId()).addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 1000000000 , 1000000000));
- Bukkit.getScheduler().scheduleSyncRepeatingTask(this , new Runnable()
- {
- public void run()
- {
- G.get(player.getUniqueId()).teleport(player.getLocation().add(1, 0, 0));
- }
- }, 0, 1);
- }
- if(args[0].equalsIgnoreCase("guardiankill")) {
- G.get(player.getUniqueId()).remove();
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement