Tips & tricks - Zedd7/ZHorse GitHub Wiki
- Commands
-
Administration
- How to protect horses against dragon breath ?
- How to get rid of claimed horses idling in the spawn or in the wild ?
- How to use
/zh admin import
? - How to upgrade from 1.5.2- to 1.6.0+ ?
- How to upgrade from 1.6.9 to 1.7.0+ ?
- How to create a custom localization file ?
- Unexpected "limit reached" message
- Horse teleportation bug
- Horse teleportation blocked
- Unable to dismount a horse
- Mount-dismount loop
- Swiftness potion bug exploit
Let's take the command usage /zh give (-i horseID) (-p) playerName
for example. This syntax means that you have to provide a player name, but using the -p
flag identifier and providing the -i horseID
flag is optional (It however gives you better control on the command).
In other words, ZHorse will be happy with /zh give Zedd7
as a command instance (Give the horse you are mounting to Zedd7) but will also accept /zh give -i 5 -p Zedd7
(Give your 5th horse to Zedd7).
Take a look at the Command page to learn how to master ZHorse commands.
There are three security levels
-
locked
(enable/disable with/zh lock
): No one, except the owner and friends, can mount the horse nor edit its inventory. -
restricted
(default security level): Everyone can mount the horse but only the owner and friends can edit its inventory. -
shared
(enable/disable with/zh share
): Everybody can mount the horse and edit its inventory.
And one protection mode against damages :
-
protected
(enable/disable with/zh protect
) : Protected horses cannot be damaged by some events defined by the server's administration.
All these modes can be assigned by default when a horse is claimed by enabling the config option Settings.{lock, share, protect}-on-claim
.
Once a horse has been put up for sale using the /zh sell <price>
command, it can be withdrawn from sale using the same command but with the price left blank.
Claiming or giving a horse for sale will also withdraw it from sale.
Because locked horses cannot be mounted by potential buyers, one could wonder how they are supposed to buy the horse ? Here are two solutions :
- Unlock the horse and thus put it in
restricted
mode. As explained in the protection modes tutorial, players will be able to try the horse before buying it but won't be able to open its inventory. To prevent them from stealing the horse, either bring it back with/zh here
or/zh stable
, or showcase him in a locked area. - Keep the horse locked. Horse stats will be displayed to potential buyers when they attempt to mount it in the same fashion as
/zh info
. To buy the horse, they would then need to execute/zh buy <horse name> -p <owner name>
as explained in the advanced use of commands tutorial.
Having a player in your friends list allows him to bypass control protections of your horse and consider the latter as shared
, regardless of its actual status. However, it doesn't bypass management protections.
Thus, that player will be able to mount your horse, open its inventory and perform any control command such as /zh here
or /zh tp
on it. Management commands such as /zh free
or /zh sell
will still be blocked.
First, type /zh help spawn
. A list of horse variants, styles and colors will be displayed to you, in addition to the command usage :
/zh spawn (variant) (style) (color) ('tamed') ('adult' | 'baby') (health):(speed%):(jump%) (strength)
As all arguments are between parenthesis, you can skip or swap any of them. However, if you provide either the health, speed or jump argument, you must provide the two colons ::
and insert the desired horse statistic at the adequate position.
Take note that the values of the speed and the jump strength must be given accordingly to the stats display mode that you have chosen with the /zh settings stats <display mode>
command.
Also, tamed
, adult
and baby
are to be written in full, while strength
defines how many items a llama chest can hold, meaning you must provide a value between 1 and 5 (see "Strength" NBT-tag on Minecraft wiki).
Any argument (including the horse variant) left blank will be chosen randomly.
Let's now take a look at the following valid examples :
Command | Effect |
---|---|
/zh spawn | Spawn a random horse, donkey, mule or llama with random appearance and statistics. |
/zh spawn zombie tamed baby | Spawn a tamed baby undead horse. (undead_horse, undead, zombie and zomb are also valid). |
/zh spawn tamed donkey 20:15%:50% | Spawn a tamed donkey with 20 hearts, 15% of the maximum speed and 50% of the maximum jump strength. |
/zh spawn whitefield chestnust 20::50 | Spawn a wild horse with custom appearance, 20 hearts, 50% of the maximum jump strength and a random speed. (Note that you can also skip the '%' char) |
/zh spawn baby :30%: mule tamed | Spawn a tamed baby mule with 30% of the maximum speed and random values for hearts and jump strength. |
/zh spawn lama creamy 4 | Spawn a wild llama with custom appearance and a strength of 4, meaning it can carry 3*4 = 12 stacks in its chest. |
Currently, the protection DRAGON_BREATH
is available for use in the config but is not used by Bukkit/Spigot. Use ENTITY
instead.
On servers on which claimed horses are automatically locked and protected, the spawn or other places of interest can quickly be overcrowded by horses belonging to unconcerned players.
This can be solved by enabling Settings.send-to-stable-on-owner-logout
and defining Settings.default-stable-location
in the config.
An additional trick is to enable the config option Settings.block-leashed-teleport
so that players can avoid unwanted teleportation by leashing their horses to a fence.
This command is to be used only if you plan to switch to another database (YAML -> SQLite
, YAML -> MySQL
, SQLite -> MySQL
or MySQL -> SQLite
).
The conflict policy is to ignore changes for already existing records. Thus, it is not recommended to use this command if your new database is already partially filled after days of use.
If ZHorse is not already using the new database, you must configure the config to do so and execute /zh reload
to apply the changes.
Then, execute /zh admin import <old database>
to automatically import your old data into your new database.
Since version 1.6.0 YAML
databases are no longer supported. MySQL
(complex but powerful) or SQLite
(simple but basic) are to be used instead. To import your old YAML
database, follow the steps below :
- Stop your server
- Delete or rename
config.yml
to generate the new options - Delete or rename any
locale_XX.yml
file to generate the new messages - Update
ZHorse.jar
to version 1.6.0 or newer - Restart your server
- Configure the parameters for the database you want to use in config (by default, a
SQLite
database is automatically generated) - Execute
/zh reload
to apply the changes - Execute
/zh admin import YAML
to import your old data into your new database (more details in/zh admin import
tutorial)
In version 1.6.9, a bug caused cleared (freed, dead or removed) horses' owner entry in the database to be partially corrupted. This is now fixed as of version 1.7.0 but may require some maintenance from you. Please find all necessary informations here.
- Duplicate one of the provided localization file (for example
locale_EN.yml
) and rename the duplicate to a meaningful name corresponding to its target language (for examplelocale_JP.yml
for Japanese). - Translate the content of the file in the target language and edit the color codes (for example
<yellow>
) at will, but take care to not remove any flags (for example<horse>
). - Append the language's code (for example
JP
) to the list of indexLanguages.available
in the config. Optionally, replace the default language by the new language's code. - Execute
/zh reload
or restart your server. New players will be using the new language immediately if you have defined it as the default language. Old players will need to execute/zh settings language JP
to start using the new language. - Take care to keep a copy of the localization file that you used as a base (for example
locale_EN.yml
). You will need to compare its content with that of its new version each time ZHorse is updated. Indeed, it often happens that new lines are added, that indexes are changed and that old lines' flags are removed or added. - Alternatively to
5
, it is recommended to suggest your custom localization file as the official translation in your language (if it is not already a provided language) to the plugin's author. You will then be consulted before the release of every new version to update the content of your file, hence avoiding5
by keeping it up-to-date.
If a player is told that his claim limit has been reached but, according to the config, it should not, it is very likely that the Groups
config section has been wrongly configured.
If the player belongs to the permission group "ExampleGroup" (defined by a plugin like PermissionsEx) make sure that there is an entry for this group in ZHorse's config (the name of the group must match) and that the claims-limit
value is greater than 0.
Note that the permission
config option of a group must only be used if you don't want the configured group name to match an existing permission group name ! If so, ZHorse will act like if that configured group actually existed and will consider that any player belongs to that group if he doesn't belong to an existing group and has the configured permission.
The example below describes such a fake group.
Groups:
ExampleGroup:
color: <dark_aqua>
color-bypass: false
claims-limit: 5
FakeGroup:
color: <dark_aqua>
color-bypass: false
claims-limit: 5
permission: zh.group.fake
If teleporting a horse using /zh here
causes it to disappear, consider setting Settings.use-old-teleport-method
to true
in the config. It will switch the teleportation method to Bukkit's one.
If a horse cannot be teleported or spawned (becomes invisible) in a Worldguard region in which the flag mob-spawning
is denied, set block-plugin-spawning
to false
in Worldguard's config.
If a player is told he cannot dismount a horse, set the concerned region's Worldguard ride
flag to allow
.
If a player tries to mount a locked horse and ends up stucked in an infinite mount-dismount loop, update the plugin HorseTpWithMe.
If mounting or dismounting a horse affects its speed (by a lot if the horse is under a swiftness potion effect), reach out for the developper of ArmorWeight or adjust ArmorWeight's config.