Initialize the NPC Platform
v3To use NPC-Lib, you must first obtain a platform instance using a platform-specific builder. Once you have the platform instance, you can create and manage NPCs without needing to know the underlying implementation details.
Platform Builders
- Bukkit:
BukkitPlatform.bukkitNpcPlatformBuilder() - Minestom:
MinestomPlatform.minestomNpcPlatformBuilder() - Fabric:
FabricPlatform.fabricNpcPlatformBuilder()
// Example: Initializing a Bukkit platform
var platform = BukkitPlatform.bukkitNpcPlatformBuilder()
.extension(myPluginInstance) // Required: set the plugin/extension instance
.build();