Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onPlayerMove(PlayerMoveEvent ev) {
- Location loc = new Location(Bukkit.getServer().getWorld(cfg.getString("Blocks.block_1.loc.world")),
- cfg.getInt("Blocks.block_1.loc.X"),
- cfg.getInt("Blocks.block_1.loc.Y"),
- cfg.getInt("Blocks.block_1.loc.Z"));
- if (checkLoc(ev.getPlayer().getLocation(), loc, 11)); {
- double radius = 11;
- List<Entity> near = loc.getWorld().getEntities();
- for(Entity e : near) {
- int countNear = near.size();
- if(e.getLocation().distance(loc) <= radius && countNear <= 4) {
- Player p = ev.getPlayer();
- Random random = new Random();
- loc.add(random.nextInt(6), 4, random.nextInt(6));
- Skeleton w = p.getWorld().spawn(loc, Skeleton.class);
- w.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).setBaseValue(3);
- w.setMaxHealth(70);
- w.setHealth(70);
- w.setCustomName(ChatColor.DARK_PURPLE + "Страж Центру");
- w.setCustomNameVisible(true);
- w.getEquipment().setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
- w.getEquipment().setItemInHand(new ItemStack(Material.IRON_SWORD));
- w.setLastDamage(6);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement