Solved Defining spawn location

Discussion in 'Plugin Help/Development/Requests' started by Scorpionvssub, Sep 25, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Scorpionvssub

    Whats the best way to spawn any creature while Dragon in particular but any creature at a config defined location?
    Code:
        private void respawntime(int timer) {
            Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
                @Override
                public void run() {
                    createcreature();
                }
            }, timer);
    
    
        }
    
        private void createcreature() {
        }
    If it came down to a players location i'd be fine with it but in this case it would be in a diff world and on a location specified in config.
     
  2. Store the x, y, z and world in the config, create a new location using the appropriate method in YamlConfiguration to retrieve the corresponding arguments. Then spawn your entity at that location.

    Code:
    public void blahBlah() {
            location(world, x, y, z)                    
            get the server.get the world(world).spawnCreature(location, CreatureType)
    }
     
  3. Offline

    Scorpionvssub

  4. @Scorpionvssub The location should be a location object, not an integer.
     
  5. Offline

    Scorpionvssub

  6. Offline

    Scorpionvssub

  7. Offline

    pie_flavor

    @Scorpionvssub Location location = new Location(getServer().getWorld(this.getConfig().getString("Settings.world")), getConfig().getInt("Settings.x"), getConfig().getInt("Settings.y"), getConfig().getInt("Settings.z"));
     
  8. *facedesk*
     
  9. Offline

    iOnixS

  10. Offline

    Scorpionvssub

    no cause a diff plugin wouldnt work for what i had in mind and @pie_flavor That worked thanks!
     
Thread Status:
Not open for further replies.

Share This Page