What event to I need?

Discussion in 'Plugin Development' started by ChucknorisSR, Jun 20, 2015.

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

    ChucknorisSR

    So I want to spawn an entity at this specific location. What event do I need?
    Code:
    @EventHandler
        public void on( e) {
        LivingEntity skele = e.getEntity();
        if (!(skele.getType().equals(EntityType.SKELETON)))
            e.setCancelled(true);
        Util.spawn.spawnEntity(Util.SkeletonKitSelector, EntityType.SKELETON);
        skele.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 999999, 1000000000)); 
     
  2. Offline

    xXkguyXx

    You Need a OnEnable Event My Guess, and The Location of were it is going to spawn, But I'am new to coding so ... I'am not to sure
     
  3. Offline

    ChucknorisSR

    Anyone else?
     
  4. Offline

    Reynergodoy

    what? what is this code? it does not make sense, kitselector is for kits/classes
    you are trying to spawn an skeleton as a class?
     
  5. Offline

    RingOfStorms

    You say you want to spawn a skeleton at this specific location.

    What is the specific location? You're code does not look like there is any location at all associated to anything and doesn't make sense. And what are you attempting to cancel? If there is already a skeleton then why are you spawning a second one?

    Maybe you should just explain more of what you'd like to achieve.
     
  6. 1) You do not need an event
    2) You basically need this one line of code
    Code:
    player.getWorld().spawnCreature(player.getLocation(), EntityType.COW);
     
  7. Offline

    Ratismal

    In order to know what event you need, you must first know when you want the listener to activate.

    You want to spawn a skeleton, but when? What do you want to happen to trigger the skeleton spawning? The information you've provided isn't enough.
     
Thread Status:
Not open for further replies.

Share This Page