I want to create custom and interactive NPCs of players and mobs to use for my plugin. I have no clue on where and how to begin this even after about an hour of research. So I will start simply. Can anyone help me create a player/mob NPC?
Well you should probably start with understanding how to use NMS. Try playing with some packets, custom entities, etc.
Why is NMS your first response, not your last? You could just add metadata to a mob, and onClick get the metadeta and do something.
Use a Code: Entity e = YourWorld.spawn(loc, Pig.class); then, (Well I didn't study metadata yet, so if anyone could tell me..) Code: e.setCustomName("Teller"); e.setCustomNameVisible(false); Then on click, test for the name "Teller"
ChipDev Shouldn't really suggest that people use something you yourself don't know how to use. Edit: @ suggesting NMS, the OP wanted Player NPCs, which requires NMS or related libraries. 1928i Look at the Metadatable interface and its methods, Entities, Blocks, and Worlds implement it, meaning you can attach metadata to them using the methods
ChipDev 1928i I'd go with Code:java Pig pig =(Pig) p.getWorld().spawnEntity(p.getLocation(), EntityType.PIG);pig.setCustomName("Player");pig.setCustomNameVisible(false);
Well, I assumed he meant along the lines of Player NPCs that move around and such. That's generally what people mean when they say "NPCs".
Definition on NPC : Definition: (Move your mouse to reveal the content) Definition: (open) Definition: (close) A non-player character (NPC), sometimes known as a non-person character or non-playable character, in a game is any character that is not controlled by a player. In electronic games, this usually means a character controlled by the computer through artificial intelligence. Does it mean any player, or the player YOU control..?
In the context of threads on the Bukkit Forums in the Plugin Development section, when people say "how do I make an NPC" they have a tendency to specifically mean the sorts of NPCs that require NMS code to function.
1928i Research is how you "learn" NMS, most of the Minecraft source is obfuscated, meaning you have to do your research and deobfuscate it using what little knowledge is provided.
player = player that spawned specific mob, either from interactEvent with monster_egg or from command; Something alongside the lines of a pet(disguised as a block, perhaps. I'll need ProtocolLib for this, I know that for a fact.), that follows the player around (toggleable) that the player can interact with onClick.
octoshrimpy For the following, you would probably need to use NMS (unless you created your own pathfinding system and handled the mobs purely with packets and ProtocolLib). Or perhaps EntityAPI in the future DSH105 CaptainBern
Garris0n I know these exist: http://forums.bukkit.org/threads/ea...mobs-without-replacing-the-default-mob.264172 http://forums.bukkit.org/threads/lib-1-7-9-petmaker-v1-0-how-to-make-pets.273951/ Now its just a matter of figuring out what does what and editing it to do what I want. (already added a speed variable to the petmaker, so i'm getting there slowly) (thanks bigteddy98!)