Why would this code not work?

Discussion in 'Plugin Development' started by Evrlyn, Apr 6, 2017.

Thread Status:
Not open for further replies.
  1. Code:
     package com.evrlyn.jump;
    
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.player.PlayerRespawnEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.potion.PotionEffect;
    import org.bukkit.potion.PotionEffectType;
    
    
    public class Jump extends JavaPlugin {
        @EventHandler
        public void onSpawn(PlayerRespawnEvent event) {
            event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 200, 1));
        }
    }
    Code:
    name: Jump
    main: com.evrlyn.jump.Jump
    version: 1.0
     
  2. Offline

    Zombie_Striker

    @Evrlyn
    You're not registering the class. Let the class implement listener and register the class in the onEnable.

    Also, you do not own evrlyn.com. Do not use it in your package name.
     
  3. Offline

    ClassifiedDev

    @Evrlyn
    Yea what Zombie said you need to let your jump class implement Listener and you need to register the event in onEnable.

    @Zombie_Striker
    No one owns evrlyn.com,(At least if was avaliable when I checked) I don't see why he cant use it in his package name.. Evrlyn is his/her name and a lot of dev's use com in the beginning of the package name. And it does'nt even say evrlyn.com
     
    Last edited: Apr 6, 2017
  4. Offline

    Zombie_Striker

    @ClassifiedDev
    That is exactly why she should not use it. She does not own it, no one does, so she has no rights over that domain or any reference to that domain. That is the same reason why you can use com.google as your package name.

    BTW: They either use the 'com' extension incorrectly (in which case, why would you want to also do something wrong) or they actually own that domain.

    @Evrlyn
    Package names can be a domain you own, your email address, or must use the format "me.<your name>.<your project>".
     
Thread Status:
Not open for further replies.

Share This Page