Updates for v1.3.
This commit is contained in:
@@ -3,27 +3,33 @@ NPCLib – Basic non-player character library.<br>
|
||||
[](https://github.com/JitseB/NPCLib/releases)
|
||||
[](https://travis-ci.com/JitseB/NPCLib)
|
||||
[](http://jdk.java.net/8/)
|
||||
[](https://github.com/JitseB/NPCLib/releases)
|
||||
[](https://github.com/JitseB/NPCLib/releases)
|
||||
=
|
||||
|
||||
This is an API made specifically for spigot servers (Minecraft). Current supported versions: **1.8 - 1.13**. Lightweight replacement for Citizens. NPCLib only uses packets instead of registering the entity in the actual Minecraft server.
|
||||
This is an API made specifically for spigot servers (Minecraft). Current supported versions: **1.8 - 1.13.2**. Lightweight replacement for Citizens. NPCLib only uses packets instead of registering the entity in the actual Minecraft server.
|
||||
|
||||
**Resource**: https://www.spigotmc.org/resources/npclib.55884/
|
||||
**Thread**: https://www.spigotmc.org/threads/npclib-–-basic-non-player-character-library.314460/
|
||||
**Preview**: https://youtu.be/LqwdqIxPIvE
|
||||
**SpigotMC Resource** https://www.spigotmc.org/resources/npclib.55884/
|
||||
**SpigotMC Thread** https://www.spigotmc.org/threads/npclib-–-basic-non-player-character-library.314460/
|
||||
|
||||
**Preview** (click to play video)
|
||||
|
||||
[](http://www.youtube.com/watch?v=LqwdqIxPIvE "NPCLib – Basic non-player character library (Minecraft).")
|
||||
|
||||
## Donate
|
||||
|
||||
[](https://paypal.me/jitseboonstra)
|
||||
|
||||
Alternatively, you can help the project by starring the repository or telling others about NPCLib :smile:
|
||||
Alternatively, you can help the project by starring the repository or telling others about NPCLib. :smile:
|
||||
|
||||
## Usage
|
||||
## Developers
|
||||
|
||||
It is recommended to shade `NPCLib-API-v*.jar` into your plugin.
|
||||
Alternatively, you may put `NPCLib-Plugin-v*.jar` under your `plugins` folder. By using this option, you do not need to shade the API JAR anymore. Though, do not forget to add `NPCLib` as a dependency in your `plugin.yml`!
|
||||
### Usage
|
||||
|
||||
You can download the latest release [here](https://github.com/JitseB/NPCLib/releases/latest).
|
||||
It is recommended to shade `npclib-api-v*.jar` into your plugin.
|
||||
Alternatively, you can put `npclib-plugin-v*.jar` under your `plugins` folder. By doing this, you no longer need to shade the API JAR. Though, do not forget to add `NPCLib` as a dependency in your `plugin.yml`!
|
||||
|
||||
|
||||
[Click here](https://github.com/JitseB/NPCLib/releases/latest) to download the latest release.
|
||||
|
||||
```Java
|
||||
// First we define our (global) library variable.
|
||||
@@ -33,26 +39,35 @@ You can download the latest release [here](https://github.com/JitseB/NPCLib/rele
|
||||
|
||||
```Java
|
||||
|
||||
// Creating an NPC.
|
||||
// Creating a new NPC instance.
|
||||
NPC npc = lib.createNPC(skin, lines);
|
||||
|
||||
// The generate the packets for the NPC.
|
||||
// Then let the library generate the necessary packets.
|
||||
npc.create(location);
|
||||
|
||||
// Then *finally* you can show/hide it to/from players.
|
||||
// You are all set! You can now show/hide it to/from players.
|
||||
npc.show(player);
|
||||
npc.hide(player);
|
||||
|
||||
// If you do not use the NPC anymore, destroy the NPC accordingly.
|
||||
// If you do not wish to use the NPC anymore, destroy it accordingly.
|
||||
npc.destroy();
|
||||
```
|
||||
|
||||
Usable events: `NPCSpawnEvent`, `NPCDestroyEvent` and `NPCInteractEvent`.
|
||||
### Events
|
||||
|
||||
Events you may want to use are `NPCSpawnEvent`, `NPCDestroyEvent` and `NPCInteractEvent`.
|
||||
|
||||
### Building your own version
|
||||
|
||||
1. [Download](https://github.com/JitseB/NPCLib/archive/master.zip) or clone this repository.
|
||||
2. Build the plugin using `sh build.sh`. Alternatively, you can build the API JAR manually using `mvn clean install`.
|
||||
|
||||
You can build the plugin using `mvn clean install -pPlugin`.
|
||||
|
||||
## License and plugins using NPCLib
|
||||
|
||||
NPCLib is licensed under the [MIT license](https://github.com/JitseB/NPCLib/blob/master/LICENSE.md).
|
||||
Developers are free to use NPCLib for both private and commercial use. Though, it would be nice to acknowledge me.
|
||||
Developers are free to use NPCLib for both private and commercial use. However, it would be nice to acknowledge me.
|
||||
|
||||
You (the developer) can also contact me if you wish to be added to the list below.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user