What should I do

Discussion in 'Plugin Development' started by YgtGamingTR, May 6, 2017.

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

    YgtGamingTR

    what should I write to Player oyuncu =
    Code:
    package seri.katil.sk;
    
    
    import org.bukkit.Bukkit;
    import org.bukkit.World;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.potion.PotionEffect;
    import org.bukkit.potion.PotionEffectType;
    
    public class SkClass extends JavaPlugin implements Listener {
        public <PlayerMove> void onPlayerMove(PlayerMove e){
            Player oyuncu = Bukkit.player ;
            for (World world : this.getServer().getWorlds()){
                if (oyuncu.hasPermission("SeriKatil"))
                if (world.getTime() >= 13000){
                    oyuncu.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 18000*20, 5));
                    oyuncu.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 18000*20, 3));
               if (world.getTime()<= 13000){
                   oyuncu.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 0, 1));
                   oyuncu.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 0, 0));
                }
            }
        }   
           
           
           
           
           
           
           
           
           
           
            return;
           
        }
    }
     
  2. Online

    timtower Administrator Administrator Moderator

  3. Code:
    public <PlayerMove> void onPlayerMove(PlayerMove e){
    That <PlayerMove> shouldn't be there. It's just a dangling generic type, and having that there will make your plugin not compile. Also, PlayerMove isn't a class that's a part of the Bukkit API or in your imports list. I'm going to assume you mean PlayerMoveEvent, in which case oyuncu should be set to e.getPlayer().

    Judging by this code, it looks like you don't really have a solid grasp of Java yet. I would reccomend you follow a few general Java tutorials before you jump into Bukkit plugin development. It helps to have a solid understanding of what you're using before you start using it :p
     
  4. Offline

    MrPowWow

    Why don't you just use a PlayerJoinEvent, check what time it is and then if it's that time give the player a potion effect?
     
Thread Status:
Not open for further replies.

Share This Page