teleport SPAWNED mobs CLOSER to the player

Discussion in 'Spigot Plugin Development' started by Vrsd12, Apr 17, 2017.

  1. How could I spawn a mob near a player?
  2. Look up some tutorials first of all. No one is here to spoonfeed. Do you know Java? If that's the case I'll help you.
  3. Thunder_, thanks .
    xTimPugz, I just wanted to know what the event was like before I talked question
  4. Event? Why would you need an event here? I mean you're asking how you can spawn a mob near a player?
  5. I am creating a single plugin wanted to know the name of the event to bring up a mob near a player
  6. That's not an event. An event is an object that gets fired when something happens in your world/server. Sorry that was the best explanation I could give to it. :p
    You could actually hook this up to an event and spawn a mob when you throw an egg for instance.
  7. I mean this:
    if(event.getEntityType() == EntityType.IRON_GOLEM )
  8. And to use that I need this:
    CreatureSpawnEvent event
  9. Ahh, do you want to teleport ALREADY SPAWNED mobs CLOSER to the player? By the way, you should edit your post title to something that explains your issue.
  10. If that,
    That is what I meant
  11. I'd set variables, 2 for x and 2 for y, 2 for minimum values, 2 for maximum values. Then get an average between those two using a Random object and set the mob's location with values you got from the random. (The event should have a getMod() method of some sorts).