Welkom

Wachtwoord vergeten?
Online Members
Geen
Online Gasten: 1
Page Counter
11,418
NPC, BlackSmith, Traders, Sentry, Denizens
dutchneon 0 Reacties · Likes · Zoals · 12th December 2013
You know what?  The documentation is seriously fragmented for citizens2.  I'll give you a rundown and include links.
I've gotten a whole village going, with a blacksmith, 4 sentries with bows and arrows on guard posts, a roaming melee guard, two general purpose traders, two npcs that provide item trade quests, an admin shop trader (won't run out of a given item), and finally, a builder.
The sentries are great, you can hear them all night sending arrows out into the darkness, they really keep the monsters out if you set them up in good locations.
So here we go:
First, go to the citizens2 plugin page and grab that, install it:
http://wiki.citizens...en ... s_Wiki  (look for the download link here - they are still developing and releasing new updates)

From there, you have the option of also installing specific character type plugins (like blacksmith, sentry, denizen, builder, etc).
You need those to setup npcs like I did in my village.

The most important:  sentry:  http://wiki.citizensnpcs. ... com/Sentry
Find the jar file download link in the wiki, put the jar file in your minecraft server plugin folder, reload or restart the server.
Now, use the following commands as a server op (from your character in the game, haven't done this myself from console):
When typing the commands, ignore the parenthesis and stuff in it, that's just a description of what the command does.
/npc create SentryJoe --type player --trait sentry  (makes the npc that looks like a basic player and is a sentry)
/sentry target add entity:monster (will target all hostile mobs - if you don't want it to attack creepers, use ignore - see the next line)
/sentry target ignore entity:creeper
/sentry guard (will make the sentry guard its location)
/sentry strength 3 (strength is how much damage the sentry does per hit)
/sentry armor 2 (when the sentry gets hit, this is how much damage is ignored/subtracted)
/sentry health 30 (it defaults to 20)
/sentry equip 276 (to make it hold a diamond sword - you can also use any other weapon or armor, but it's just for looks)
/sentry equip 198 (use multiple commands to put multiple pieces of armor on - to see their values, look up "minecraft data values"
/sentry healrate 10 (number of seconds between regen of 1 health, 0 to disable - I think it's disabled by default though)
/sentry respawn 180 (time in seconds between when the sentry is killed and when it respawns, if you set it to -1, when the sentry dies, it's gone for good)
/sentry attackrate 2 (time between projectile attacks - if you equip it with a bow, it will have unlimited arrows and attack every 2 seconds)
/sentry range 50 (this is the maximum range of arrows)
/sentry warningrange 0 (this turns off the annoying warning/greeting messages you get, which really are awful if you have several sentries around)
/sentry criticals (toggles critical hits/misses)
/sentry spawn (will make it respawn where it is currently)

Now that you've got your sentry setup, you can use it as your template sentry and just copy it for every one you create after.
To copy:
/npc list (shows list of npcs and their ID numbers)
/npc select # (where # is the ID number of your sentry)
/npc copy --name NameOfNewSentry (change NameOfNewSentry to whatever you want the new one called - a new sentry will appear where you are.

If you want to move a sentry, move to the new location and select the npc (as above), then do:
/npc tphere (moves the npc / sentry to your current location)
/sentry spawn (makes sure if the sentry dies, it will respawn where it is now)

Now, if you want the sentry to roam along a route, do the following:
/npc path (after entering this command, it will tell you to left click to add waypoints and right-click to remove them - right-clicking always removes the highest numbered waypoint.  If you want the movement to look smooth, put the waypoints relatively close together, or the npc will practically warp from waypoint to waypoint.  After you enter a few, the npc should automatically start moving.  If it gets frozen, you can make it start moving again by lighting it on fire - when it regenerates health, it will start moving.  As it moves along its path, it will shoot at any monsters in range, or it will move to fight them if it has a melee weapon, then continue on the route after the fight is over.)

------------------
Blacksmith:

http://wiki.citizens....c ... om/Blacksmith (grab the jar and put it in your server's plugin folder, reload or restart the server)

Commands (some of these I'm just copying from the wiki, it's been awhile)

/npc create Smithy --trait blacksmith
You can move the blacksmith as above - just use:
/npc select # (where # is the ID number of your blacksmith npc)
/npc tphere (will move the blacksmith to where you are - it won't move)

Blacksmiths are pretty much plug and play, there's not a lot of stuff you really need to change, unless you want to mess with the prices of fixing your equipment, or the fail rate (it can sometimes fail, you will still get charged, and will lose your weapon or piece of armor, which can suck if it was enchanted - adds a nice touch though).

-------------------------------

Traders:  Basically, I found CitiTrader was the best one, the other sucked and was extremely hard to use or set up, so I uninstalled them.  Don't waste your time with it.
CitiTrader:
http://wiki.citizens...iT ... raders  (once again, grab the jar, put it in your server plugin folder, reload or restart the server)

Now, it says you can add trader functionality to an existing npc by using the trait command, but I've had issues.  Your mileage may vary.
I would say to just use the "/trader create" command:
/trader create NameOfTrader -type owner (since you're creating the npc, you're the owner, the trader will use your economy account)
or
/trader create NameOfTrader -type private (the trader uses its own wallet, won't have any money starting out, but you give it items, it sells them to make money, then has enough money to buy stuff)
or
/trader create NameOfTrader -type admin (does not run out of an item once you give that type to it, I don't think this type of shop can buy items, but I could be mistaken - I haven't been able to get it to buy, only sell)

Now, hold a book and right-click the trader, it will let you add items to its inventory or remove them from it.
To set buy/sell prices (you have to set these for each item type in order for the trader to buy or sell them):
/trader buyprice 20 (and right click with the held item of the type you want to set to that buy price - the trader will now buy that item type for that price)
/trader sellprice 30 (same as above - right-click with that item type, the trader will now sell that item type for that much)
That's all you need to know for traders.
------------------
Denizen scripting:
This will let you set up things like mercenary leaders who will hire out bodyguards, or a town protection system - add people to a town enemies group when they attack any of the npc citizens in that town, or have an npc that has custom messages on click or when a player gets close and gets players to run quests, gives items in trade for other items (bartering), etc.
Now, if you read the Denizen wiki, it makes it sound like they can do a lot more than they can.  The activities they talk about like mining, cutting down trees, or harvesting crops are all still in development and not implemented yet.  They can so far do the things I described above, wander around, go to bookmarks, and move to, then click on specific blocks to activate switches or levers.

First, get the denizen plugin:
http://wiki.citizensnpcs. ... com/Denizen (grab the jar from the download link on that page, put it in your server's plugin folder, reload or restart the server)

Now, you can set any of your npcs to be a denizen (You don't make a denizen directly by using denizen commands, you add that trait to an already existing npc) by using these commands:
/npc select # (where # is that npc's ID, which you can find with /npc list)
/trait denizen (that's it - now it's a denizen...you may want to despawn the npc and respawn it to have it take affect - any time you add or remove traits, you want to do that in order to have the changes take affect):
/npc despawn
/npc spawn

Now, for scripting you'll want to modify two files in the denizen folder inside your server's plugin directory (the denizen plugin will have automatically made that folder after you added the jar file and restarted or reloaded the server).
Assignments.yml
Scripts.yml

Here's the mercenary leader's portion of both of these files: (use Notepad++ to edit and turn on where you can see all the characters, especially tabs - you don't want any tabs in a yml file or it won't work.  Also, you want the indents to be two spaces for each level.)
Each npc has to have its name in assignments.yml with the scripts that are assigned to it underneath, and it'll look something like this:
If you name the mercenary something different, make sure to change 'MercenaryLeader' to whatever the npc's name is:

Assignments.yml:
---- (these dashes just signify the beginning of the file, don't include them)
  'MercenaryLeader':  #the first character on this line starts two spaces to the right
    Interact Scripts:
    - 0 ^Merc Requirements Not Met
    - 1 ^Merc End
--- (these dashes just signify the end of the file, don't include them)

Script.yml:
---- (these dashes just signify the beginning of the file, don't include them)
'Merc Requirements Not Met':
  Type: Interact
  Requirements:
    Mode: All  #mode all includes when the player has clicked on the npc, seems to enter it into a different mode somehow
    List:
    - -MONEY 500  #Note that this means that it's checking for -MONEY 500 (the player doesn't have 500)...that's the rqt for this part
  Steps:
    1:
  Click Trigger:
    Script:
 

RSS Feed
Donate

Donate

Events
« November 2017 »
M
T
W
T
F
S
S
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
 
 
Recent Topics
Welcome to our websi...
dutchneon
20th November 2013 · Last
Top Posters
qwyleon
237 berichten