We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey, you have any simple examples to create a NPC?
The text was updated successfully, but these errors were encountered:
An example how to create a npc & pool for bukkit can be found here: NPC Pool creation, NPC creation, NPC Event subscriptions.
And here is a kotlin scratch. Works with beta v3 on 1.19.3.
import com.github.juliarn.npclib.api.Npc import com.github.juliarn.npclib.api.NpcActionController import com.github.juliarn.npclib.api.profile.Profile import com.github.juliarn.npclib.bukkit.BukkitPlatform import com.github.juliarn.npclib.bukkit.BukkitWorldAccessor import com.github.juliarn.npclib.bukkit.util.BukkitPlatformUtil import org.bukkit.Bukkit import org.bukkit.Location import java.util.* val npcPlatform = BukkitPlatform.bukkitNpcPlatformBuilder() .extension(PLUGIN_INSTANCE) .actionController { builder -> builder .flag(NpcActionController.SPAWN_DISTANCE, 60) .flag(NpcActionController.IMITATE_DISTANCE, 16) .flag(NpcActionController.TAB_REMOVAL_TICKS, 20) } .worldAccessor(BukkitWorldAccessor.nameBasedAccessor()) .build() val location = Location(Bukkit.getWorld("world"), 0.0, 0.0, 0.0) val npc = npcPlatform.newNpcBuilder() .position(BukkitPlatformUtil.positionFromBukkitLegacy(location)) .profile(Profile.resolved("name", UUID.fromString("uuid"))) .flag(Npc.LOOK_AT_PLAYER, false) .flag(Npc.HIT_WHEN_PLAYER_HITS, false) .flag(Npc.SNEAK_WHEN_PLAYER_SNEAKS, false) .buildAndTrack()
Sorry, something went wrong.
No branches or pull requests
Hey, you have any simple examples to create a NPC?
The text was updated successfully, but these errors were encountered: