Clarified the README.
This commit is contained in:
@@ -16,17 +16,18 @@ Current versions supported: 1.8 - 1.12.
|
|||||||
```
|
```
|
||||||
|
|
||||||
```Java
|
```Java
|
||||||
// If you want to spawn an NPC, you can generate it like so:
|
|
||||||
NPC npc = lib.createNPC(skin, autoHideDistance, lines);
|
|
||||||
|
|
||||||
// Then you need to generate the packets for the NPC like so:
|
// Creating an NPC.
|
||||||
|
NPC npc = lib.createNPC(skin, lines);
|
||||||
|
|
||||||
|
// The generate the packets for the NPC.
|
||||||
npc.create(location);
|
npc.create(location);
|
||||||
|
|
||||||
// Then, finally, you can show/hide it to/from players like so:
|
// Then *finally* you can show/hide it to/from players.
|
||||||
npc.show(player);
|
npc.show(player);
|
||||||
npc.hide(player);
|
npc.hide(player);
|
||||||
|
|
||||||
// If you don't use the NPC anymore, destroy it accordingly:
|
// If you don't use the NPC anymore, destroy the NPC accordingly.
|
||||||
npc.destroy();
|
npc.destroy();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class NPCLibPlugin extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MineSkinFetcher.fetchSkinFromIdAsync(168841, skin -> {
|
MineSkinFetcher.fetchSkinFromIdAsync(168841, skin -> {
|
||||||
NPC npc = npcLib.createNPC(skin, 5, Arrays.asList(
|
NPC npc = npcLib.createNPC(skin, Arrays.asList(
|
||||||
ChatColor.BOLD + "NPC Library", "",
|
ChatColor.BOLD + "NPC Library", "",
|
||||||
"Create your own", "non-player characters",
|
"Create your own", "non-player characters",
|
||||||
"with the simplistic", "API of NPCLib!"
|
"with the simplistic", "API of NPCLib!"
|
||||||
|
|||||||
Reference in New Issue
Block a user