Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.company;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.World;
- import org.bukkit.entity.Cow;
- import org.bukkit.entity.EntityType;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Glowna extends JavaPlugin {
- @Override
- public void onEnable() {
- GlownaDwa mob1 = new GlownaDwa(-183, 44, -120, EntityType.COW);
- try {
- mob1.spawnMob();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- @Override
- public void onDisable(){
- }
- }
- class GlownaDwa {
- void spawnMob() throws InterruptedException {
- Cow cow = (Cow) Bukkit.getWorld("world").spawnEntity(location, a);
- while (true) {
- Thread.sleep(60000);
- while (cow.isDead()) {
- cow = (Cow) Bukkit.getWorld("world").spawnEntity(location, a);
- }
- }
- }
- private int x, y, z;
- private EntityType a;
- GlownaDwa(int x, int y, int z, EntityType a) {
- this.x = x;
- this.y = y;
- this.z = z;
- this.a = a;
- }
- private World world = Bukkit.getServer().getWorld("world");
- private Location location = new Location(world, x, y, z);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement