Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to spawn a NPC's

Comments in 'Plugin Development' started by AndrewBit, Oct 15, 2015.

  1. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    Read the title please :)

    I'm trying right now to spawn a NPC that when a player interact with it, execute a code, can anyone help?
  2. MrGenga
    Offline

    MrGenga Active Member

    Joined:
    Jul 24, 2015
    Posts:
    75
    Minecraft User:
    MrGenga
    I try to help.... Spawn NPC, Human. Save it into the variable. And in EntityDamageByEntityEvent, test: $event->getEntity() == $yourvar, if is true cancel event, and execute code. It is an easy)
  3. GmWM
    Offline

    GmWM Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    181
    Plugins:
    3
    There is already a plugin like that. You can look into its source code.
    Check out Slapper by @jojoe77777 .
    http://forums.pocketmine.net/plugins/slapper.1267/
    jojoe77777 likes this.

Share This Page

Advertisement