Getting shooter of wither skull

Discussion in 'Plugin Development' started by ChromeHD__, Apr 25, 2015.

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

    ChromeHD__

    Okay im currently making a minigame where the player is able to shoot wither skulls i can set the shooter of it but when i try to get the shooter it says - The method getShooter() is ambiguous for the type how would i fix this ?
     
  2. Offline

    Tamir

    @ChromeHD__ Can you give me the code you're using to launch it?
     
  3. Offline

    ChromeHD__

    Code:
    Location loc = p.getEyeLocation().toVector().add(p.getLocation().getDirection().multiply(2)).toLocation(p.getWorld(), p.getLocation().getYaw(), p.getLocation().getPitch());
                   p.getWorld().spawn(loc, WitherSkull.class);
    @Tamir
     
  4. Offline

    Konato_K

    @ChromeHD__ Try using Bukkit over CraftBukkit in your build path
     
  5. Offline

    Tamir

    @ChromeHD__
    Who's the shooter here?
    Did you use p.setShooter()?
     
  6. Offline

    ChromeHD__

    @Konato_K can you link me because since the dmca take down i couldnt find a 1.8 version of bukkit
     
  7. Offline

    Konato_K

  8. Offline

    meguy26

    Edit I'm wrong
     
  9. Offline

    LetsTalkTnTHere

    First this is easier
    Code:
    public void launchSkull(Player p) {
           WitherSkull w = (WitherSkull) p.launchProjectile(WitherSkull.class);
           w.setVelocity(p.getLocation().getDirection().multiply(1.8));
           w.getShooter(); //And do whatever you want with that ;)ยต
    
    }
    
     
  10. Offline

    ChromeHD__

    i have one more small problem im getting a players level from a config and its finding it fine but its returning 0 when it should be 35 im loading it before and saving it afterwards so it should work
     
  11. Offline

    BlazingBroGamer

  12. Offline

    ChromeHD__

    @BlazingBroGamer
    Code:
        try {
                        Main.edit.load(Main.SMPlayer);
                    } catch (FileNotFoundException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    } catch (InvalidConfigurationException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }
                    Commands.SendMessage(shooter,"SuperMobs.MobLevels."+ shooter.getName() + "." + LevelSystem.getMob(shooter));
                    if(Main.edit.contains("SuperMobs.MobLevels."+ shooter.getName()+ "." + LevelSystem.getMob(shooter))){
                        Commands.SendMessage(shooter, "Found");
                        Commands.SendMessage(shooter, "" + Main.edit.getInt("SuperMobs.MobLevels."+ shooter.getName()+ "." + LevelSystem.getMob(shooter)));
                    }else{
                        Commands.SendMessage(shooter, "Not Found");
                    }
                    try {
                        Main.edit.save(Main.SMPlayer);
                    } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                    }
    its found but reutrns 0 when its 35 in the config

    i just have no idea what the problem can be

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 12, 2016
Thread Status:
Not open for further replies.

Share This Page