Creating the XML

Adding custom race XML

Creating a new custom race starts with creating directories.

Step 1: Start the plugin once. Find the /plugins/Races/custom/ directory
Step 2: Create a new file RaceName.xml, where "RaceName" is the name of your race, with no spaces.
Step 3: Open up the RaceName.xml file in a text editor.
Step 4: Write your XML using the guidelines below!

Making your XML

The goal of this guide is to explain all the features you can implement when writing your XML files for Races. You can use the example XML below for a guideline. This tutorial will only stay updated for the most CURRENT version, so older version users beware.

General Tags

(These tags should be found directly INSIDE the <cfg></cfg>)
<cfg> : Used to satisfy XML's requirement to have some form of enclosing tag. Written as the first and last tag where the last tag is a closing tag (</cfg>)
<race name="Race Name" color="AQUA" special="false"> : Used to mark the race data for a race, where "name" is the name of your race, that can contain any kind of character, including spaces. "color" is the color of the prefix (if you choose to use prefixes), available colors can be found here: http://dev.bukkit.org/server-mods/races/pages/available-prefix-colors/. "special" should be a boolean of the value true or false, that defines the races as a "special" race, that requires the user to have the permission Races.isSpecial to use that race's altars. The race tag should be closed just like every other tag with </race>
<altar msg="Welcome Message!" warp="boolean true/false" x="0" y="0" z="0" w="world"> : Used to mark the altar data for a race, where "msg" is the successful race change message shown to a player who changes their race at an altar. "warp" defines whether or not this races has a race home, which can be warped to using the command /races home. "x" defines the x-value of the warp, "y" defines the y-value of the warp, "z" defines the z-value of the warp, and "w" defines the world name of the warp. The altar tag should be closed like every other tag with </altar>

Race Tags

(These tags should be found directly INSIDE the confines of <race></race>)
<level id="0" exp="100"> : Used to declare a new level for a race, each race must have at least one group of level tags. "id" defines the level of the level +1, meaning id="0" is the same as declaring the level "1". "exp" declares the amount of exp a player must have before moving on to the next level, settings the exp="-1" will declare the level as the LAST level, and players will not be able to move beyond that level using altars.

Level Tags

<power name="Power Name" permission="essentials.fireball" /> : Used to declare a power of a race, giving the player the permission "permission". "name" is the display name of the power, and "permission" is the permission value of the power that will be given to players.
<get type="MobKill | PlayerKill | Time" amount="1" ext="Blank | MobType | RaceName" display="true" /> : Used to declare the way a level gains experience, you can have as many of these as you want, just like power tags. "type" MUST be equal to either "MobKill" for experience from mob kills, "PlayerKill" for experience from player kills, or "Time" for experience from a time interval defined in the configuration file. "amount" is the amount of experience awarded upon completion of the get's type. "ext" is an extension variable for the experience type, if you use MobKill, ext can equal nothing("") to signal all mobs will give experience, or it can be set to the name of a mob type ("Creeper") to signal only that type of mob will give experience. You can also use ext to signal that killing a player with a particular race will give experience, for example if you have type="PlayerKill" and ext="Neturaling" only neutralings will give experience when killed, you can also leave ext="" to signal all players will give experience upon death. Leave ext="" for the type "Time." "display" is a boolean true/false that defines whether or not the player will be informed they gained experience from completing the get's type.

Altar Tags

<blocks radii="3" /> : Used to mark the group of blocks, as well as the search radii of the race's altar. "radii" is the radii that a block tag defined as clickable will search for altar blocks. The blocks tag should be closed like every other tag using </blocks>
<items> : Used to define the group of items that must be sacrificed to gain levels or join the race. The items tag should be closed like every other tag using </items>.

Blocks Tags

<block id="133" click="true" amount="1" /> : Used to define a block that is required to create an altar. "id" defines the ID of the block to be used in altar creation. "click" is a boolean true/false that defines whether or not if a player right clicks the block it will register as an attempt to use an altar, the search radius will also be centered around the clicked block. "amount" is the amount of blocks required to exist inside the altar radius for the altar to be complete.

Items Tags

<item id="1" amount="5" /> : Used to define an item that is required for altar use. "id" defines the item's id value. "amount" defines the amount of the item that is required for altar use.

Example XML

<cfg>
<race name="Neutraling" color="AQUA" special="false">
	<level id="0" exp="0">
		<get type="MobKill" amount="1" display="true" ext="Skeleton"/>
		<get type="PlayerKill" amount="10" display="true" ext="Neutraling"/>
		<power name="Fireball" perm="essentials.fireball" />
	</level>
	<level id="1" exp="100">
		<get type="Time" amount="5" display="true" ext=""/>
		<power name="Kitty Cannon" perm="essentials.kittycannon" />
	</level>
	<level id="2" exp="-1">
		<power name="Kitty Cannon" perm="essentials.kittycannon" />
		<power name="Fireball" perm="essentials.fireball" />
	</level>
</race>

<altar msg="Default Message!" warp="false" x="0" y="0" z="0" w="world">
	<blocks radii="3">
		<block id="1" click="false" amount="5"/>
		<block id="133" click="true" amount="1"/>
		<block id="5" click="false" amount="5"/>
	</blocks>
	<items>
		<item id="1" amount="5" />
		<item id="2" amount="3" />
	</items>
</altar>
</cfg>

Comments

Posts Quoted:
Reply
Clear All Quotes