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. Offline

    MrBlackIsBack

    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. Offline

    MrBlackIsBack

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

    Scorpionvssub

  6. Offline

    MrBlackIsBack

  7. Offline

    Scorpionvssub

  8. 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"));
     
  9. Offline

    MrBlackIsBack

    *facedesk*
     
  10. Offline

    iOnixS

  11. 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