✅ [API] Player NPC ✅  [1.17 - 1.20.1] icon

✅ [API] Player NPC ✅ [1.17 - 1.20.1] -----

Player NPC Lib via packets API for 1.17, 1.18, 1.19 & 1.20



✅ [API] PlayerNPC ✅ 2022.2 version
This is a BIG update to the API, please read carefully all the changes.

Before updating your plugin, check if all dependencies are updated with this version.


New features!
  • Introducing Movement for the NPCs. This means that now you can move the NPCs around the world (walking, crouching, swimming, etc..) Click here to see an example.
    • Added NPC.Move.Speed with (SLOW, NORMAL, SPRINT)
    • Added npc.goTo(Location, boolean lookToEnd, NPC.Move.Speed);
    • Added npc.goTo(Location);
    • Added npc.goTo(Location, boolean lookToEnd);
    • Added npc.goTo(Location, NPC.Move.Speed);
    • Added npc.cancelMove();
    • Added npc.setMoveSpeed(NPC.Move.Speed);
    • Added npc.setMoveSpeed(double);
  • Introducing Move Behaviour for the NPCs. This means that NPCs automatically will move following the selected behaviour. There are 4 types of behaviour:
    • Follow Player: The NPC will follow the player who see its around the world, and if the target changes the world, the NPC will continue following.
      • Added npc.followPlayer();
      • Added npc.followPlayer(double minDistance, double maxDistance);
    • Follow Entity: The NPC will follow the selected entity around the world.
      • Added npc.follow(Entity);
      • Added npc.follow(Entity, double minDistance, double maxDistance);
      • Added npc.follow(Entity, double minDistance);
    • Follow NPC: The NPC will follow another NPC around the world. Note: NPC cannot follow himself.
      • Added npc.follow(NPC);
      • Added npc.follow(NPC, double minDistance, double maxDistance);
    • Custom Path: The NPC will go to the different locations, following the path. The Path have different types
      • Repetitive path: The NPC will do the path, and when finish, it will do the path another time, everytime.
        • Added npc.setRepetitivePath(Location...);
        • Added npc.setRepetitivePath(List<Location>);
      • Normal path: The NPC will do the path, but when finish it, it will remain at the last location.
      • Back to Start path: The NPC will do the path, and when it finish, it will return to the start location.
      • Added npc.setPath(Move.Path.Type, List<Location>);
      • Added npc.setPath(Move.Path.Type, Location...);
    • Added npc.cancelMoveBehaviour();
  • Introducing Animations, with this feature you will be able to play some animations on the NPC such as (SWING_MAIN_ARM, TAKE_DAMAGE, SWING_OFF_HAND, CRITICAL_EFFECT, MAGICAL_CRITICAL_EFFECT)
    • Added npc.playAnimation(NPC.Animation);
    • Added npc.hit();
  • You will be able to set the NPC on fire. (Known bug: setting off fire while NPC is glowing won't work, because of a Metadata bug)
    • Added npc.setOnFire(boolean);
    • Added npc.setFireTicks(Integer);
  • You will be able to Teleport between worlds, you only need to teleport the NPC to a location with a different world.
    • Added npc.teleport(World, double x, double y, double z);
    • Added npc.teleport(World, double x, double y, double z, float yaw, float pitch);
    • Updated npc.teleport(Location); and npc.teleport(Entity);
  • Added New Events to listen on a Listener:
    • Added NPC.Events.FinishMove
    • Added NPC.Events.Move
    • Added NPC.Events.Teleport
    • Added NPC.Events.StartMove
  • Added New Custom Click Actions, to add when player interacts at the NPC.
    • Send to a Bungee Server
      • Added npc.addConnectBungeeServerClickAction(NPC.Interact.ClickType clickType, String server)
      • Added npc.addConnectBungeeServerClickAction(String server)
    • Send ActionBar message
      • Added npc.addActionBarMessageClickAction(NPC.Interact.ClickType clickType, String message);
      • Added npc.addActionBarMessageClickAction(String message);
    • Send Title and Subtitlte
      • Added npc.addTitleMessageClickAction(NPC.Interact.ClickType clickType, String title, String subtitle, int fadeIn, int stay, int fadeOut);
      • Added npc.addTitleMessageClickAction(String title, String subtitle, int fadeIn, int stay, int fadeOut);
  • Introducing Skin Parts, whit this new feature, you will be able to customize the parts of the NPC.Skin. Note: when setting the parts of the NPC.Skin, you will need to do npc.setSkin(NPC.Skin); to apply changes to the NPC's skin.
    • Added npcSkin.getParts();
    • Added npcSkin.getParts().enableAll();
    • Added npcSkin.getParts().disableAll();
    • Parts of the NPC.Skin (Cape, Jacket, Left Sleeve, Right Sleeve, Left Pants, Right Pants, Hat)
  • Added npc.setGlowingColor(NPC.Color);
  • Added npc.lookAt(float yaw, float pitch);
Code changes (this may produce errors on old plugin dependencies)

With this new update, all the objects previously called NPCObject are now called NPC.Object , and other things are moved into a more organized way.
  • NPCSkin is now called NPC.Skin
  • All the events are now called different.
    • NPCHideEvent is now called NPC.Events.Hide
    • NPCShowEvent is now called NPC.Events.Show
    • NPCInteractEvent is now called NPC.Events.Interact
  • NPCAttributes is now called NPC.Attributes
  • NPC.TextOpacity is now called NPC.Hologram.Opacity
  • NPCInteractEvent.ClickType is now called NPC.Interact.ClickType

Future updates:

  • Global NPCs will be and object to manage a Global NPC object that will manage all the personal NPCs of all the players. This will help to create NPCs visible for all the players, but customizable for each player at the same time (for example, all the players will see the NPC but each will see with their own Skin), and this will redouce server lag. This is a lot requested feature, and will be introduced probably in the next update.
  • Persistent NPCs will be the posibility to save all the Global NPC data into a file, and will be saved when the server closes, and loaded when the server starts. With this you will be able to create NPCs that will be persistent forever, until you remove it. Very useful, for example, to create the NPCs of a Lobby for selecting game modes. This feature will be introduced in a few updates ahead.
  • NPC command will be more useful, with all this new features. Remmeber that this command is only for experimental purposes, and in the future will be fully usefull with the Persistent and Global NPCs
I hope you enjoy this new update, and leave feedback. Thank you for using PlayerNPC API :)
----------, Feb 12, 2022
Resource Information
Author:
----------
Total Downloads: 63,698
First Release: Jun 25, 2021
Last Update: Jun 15, 2023
Category: ---------------
All-Time Rating:
42 ratings
Find more info at sergiferry.github.io...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings