[Help] Spawn mob where snowball lands

Discussion in 'Plugin Development' started by dajako, Aug 12, 2013.

Thread Status:
Not open for further replies.
  1. How can I do this?
    I am fairly experienced with making plugins but can't work out what I need for this to happen.
     
  2. Offline

    Dyprex

    This could be useful.
     
  3. I've seen that already, I am confused on how to use the ProjectileHitEvent. Do I need to create a public void for it or what?
     
  4. Offline

    Dyprex

    Dig into Bukkit programming first and learn the basics, otherwise you won't be able to program your own plugin. I know that it sounds dumb for a Bukkit newbie, but you'll understand it if you are able to find a solution by yourself.

    Of course I could simply post the solution, but there will be more problems while programming and you can't ask the community for solving every problem. So for that, you have to learn Bukkit programming, its essential!
     
  5. :) I'll keep looking into it.
     
    Dyprex likes this.
  6. Offline

    bobacadodl

    Dyprex likes this.
  7. Offline

    Dyprex

    dajako
    I'm impressed by your post, the most guys would start flaming when they get that sort of answer I replied.

    The best place to go for learning the basic stuff should be Bukkits Plugin Tutorial. Hope that helps.

    bobacadodl
    Nice, you ruined my whole posts and intention. Congratz..
     
    bobacadodl likes this.
  8. I didn't see the post that Bobacododl made :) lol
    Yea, when I made my first plugin I watched a few tutorials, looked at all of the things used in all of them and then made a different plugin with them things. Best way to learn >:}

    Got it:
    @EventHandler
    public void snowballzombie(ProjectileHitEvent event) {
    if(event.getEntity() instanceof Snowball){
    Entity entity = event.getEntity();
    Location location = entity.getLocation();
    World world = entity.getWorld();
    world.spawnEntity(location, EntityType.ZOMBIE);
    }
    }

    Took a while but yea!
    I was getting the location wrong lol.

    Now! Time to make it spawn 5 zombies with potion buffs! No idea where to start lol.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
    bobacadodl likes this.
  9. Offline

    Dyprex

    You could start looking at this method of the world object.
     
Thread Status:
Not open for further replies.

Share This Page