Anonymous
Not logged in
English
Create account
Log in
Vintage Story Wiki
Search
Export translations
From Vintage Story Wiki
Namespaces
More
More
Page actions
Language statistics
Message group statistics
Export
Settings
Group
Accessibility
Adjustable FPS Video Recording
Alcohol brewing
Alum
Ambience Features
Animal husbandry
Anvil
Archimedes screw
Armor
Armor stand
Arrow
Arrowhead
Axe
Backpack
Bag
Bandage
Barrel
Base return teleporter
Basket
Bear
Bed
Beekeeping
Beenade
Bees
Beeswax
Bell
Berry
Bighorn sheep
Bismuth
Blackguard armor
Block reinforcement
Bloomery
Boards
Bone
Bonemeal
Bony ribcage
Bony soil
Book
Bookshelf
Bookshelf (legacy)
Borax
Bot System
Bow
Bowl
Brass
Bread
Brick blocks
Brigandine armor
Bronze
Bug net
Butterfly
Cabbage
Carpet
Carrot
Cassava
Casting
Category:Armor
Category:Bags
Category:Blocks
Category:Building Blocks
Category:Combustibles
Category:Creative Mode
Category:Creatures
Category:Crops
Category:Entity Loot
Category:Fertile Blocks
Category:Foods
Category:Fuels
Category:Game Content
Category:Guides
Category:Hostile creatures
Category:Inventions
Category:Items
Category:Light Emitters
Category:Liquid storage
Category:Lore
Category:Mechanisms
Category:Metals
Category:Minerals
Category:Outdated pages
Category:Pigments
Category:Priority translation
Category:Storage
Category:Structures
Category:Stubs
Category:Tools
Category:Transitionable
Category:Transport
Category:UI
Category:Under construction
Category:Weapons
Cellar
Ceramic Blocks
Chain armor
Charcoal
Cheese
Chest
Chicken
Chisel
Cinematic Camera
Cinnabar
Classes
Clay
Clay forming
Clay oven
Cleaver
Client startup parameters
Cloth
Clothes
Club
Coal
Coke
Collectibles
Combat
Compost
Container
Controller Compatibility
Controls
Cooking
Cooking pot
Coordinates
Copper
Cracked vessel
Crafting
Crafting Recipes
Crate
Crock
Crucible
Crude oar
Debarked log
Debugging
Display Case
Door
Drifter
Dry grass
Dye
Egg
Falx
Farming
Fat
Feather
Fence
Fire Brick
Firepit
Firestarter
Firewood
Flax
Flax fibers
Flint
Flower
Flowerpots
Food preservation
Foraging
Forge
Forlorn Hope armor
Fox
Framerate and Performance
Frequently Asked Questions (FAQ)
Fruit Press
Fruit tree
Fuel
Gambeson armor
Gazelle
Gemstone
Glass
Glider
Gold
Grain
Grass
Gravel
Greenhouse
Ground Storage
Guide:Creative mode
Halite
Hammer
Hand basket
Hare
Hay
Health
Help:How to help
Helve hammer
Henbox
Historic Crafting Recipes
Hoe
Honeycomb
Hostile entities
How to use WorldEdit
Humanoid
Hunter's backpack
Hyena
Immobilized eidolon
Improvised body armor
Ingot
Ink and quill
Installing the game on Linux
Iron
Jam
Jonas part
Knapping
Knife
Ladder
Lamellar armor
Land claiming
Lapis lazuli
Lead
Leather
Leather armor
Leather bracers
Leather jerkin
Leather reinforced mask
Leather working
Light sources
Lightning rod
Lime
Linen
Linen sack
List of client commands
List of client commands/cam
List of client commands/clientconfig
List of server commands
List of server commands/debug
List of server commands/entity
List of server commands/gamemode
List of server commands/group
List of server commands/info
List of server commands/land
List of server commands/macro
List of server commands/player
List of server commands/role
List of server commands/serverconfig
List of server commands/time
List of server commands/tp
List of server commands/weather
List of server commands/wgen
Locust
Log
Lore book
Macro
Main Page
Mantle
Meal
Meat
Meat stew
Mechanical
Mechanical power
Metal
Metal parts
Metal plate
Metal scraps
Metal spike
Meteoric iron
Meteorite
Mining
Mining bag
Modding:Adding Block Behavior
Modding:Advanced Blocks
Modding:Advanced Items
Modding:Animation
Modding:Asset System
Modding:Asset Type - BlockTypes
Modding:Asset Type - Entities
Modding:Asset Type - ItemTypes
Modding:Asset Type - Patches
Modding:Asset Type - Recipes
Modding:Asset Type - Recipes (Alloy)
Modding:Asset Type - Recipes (Barrel)
Modding:Asset Type - Recipes (Clayforming)
Modding:Asset Type - Recipes (Cooking)
Modding:Asset Type - Recipes (Grid)
Modding:Asset Type - Recipes (Knapping)
Modding:Asset Type - Recipes (Smithing)
Modding:Asset Type - Shapes
Modding:Asset Type - Sounds
Modding:Asset Type - Textures
Modding:Asset Type - WorldProperties
Modding:Basic Block
Modding:Basic Content Tutorials
Modding:Basic Entity
Modding:Basic Inventory Handling
Modding:Basic Item
Modding:Basic Modding Examples
Modding:Block and Item Interactions
Modding:Block Entity
Modding:Block Json Properties
Modding:Chunk Moddata
Modding:Code Mods
Modding:Code Tutorial Simple Block
Modding:Commands
Modding:Community Resources
Modding:Content Mods
Modding:Content Tutorial Basics
Modding:Content Tutorial Block Variants
Modding:Content Tutorial Item Variants
Modding:Content Tutorial Simple Block
Modding:Content Tutorial Simple Item
Modding:Content Tutorial Simple Recipe
Modding:Creating Recipes
Modding:Developing a Content Mod
Modding:Entity Json Properties
Modding:Getting Started
Modding:GUIs
Modding:Intermediate Content Tutorials
Modding:Item Json Properties
Modding:JSON Patching
Modding:Load Order
Modding:Mod Packaging
Modding:Mod-Engine Compatibility
Modding:Moddable Mod
Modding:Modding API Updates
Modding:Modding Efficiently
Modding:Network API
Modding:Other Content Tutorials
Modding:Preparing For Code Mods
Modding:Programming Languages
Modding:Rendering API
Modding:SaveGame ModData
Modding:Server-Client Considerations
Modding:Setting up your Development Environment
Modding:Simple Particles
Modding:Textures
Modding:The Remapper
Modding:Theme Pack
Modding:TreeAttribute
Modding:Tutorial Template
Modding:VS Model Creator
Modding:VS Model Creator tutorials
Modding:World Access
Modding:WorldGen API
Modding:WorldGen Concept
Modding:WorldGen Configuration
Modinfo
Mold
Mortar
Mushroom
Nails and strips
Nickel
Night vision mask
Off-hand
Omok
Onion
Ore
Ore blasting bomb
Ore Deposits
Other Plants
Painting
Panning
Parchment
Parsnip
Path
Peanut
Peat
Peat brick
Pickaxe
Pigment
Pineapple
Pit kiln
Planks
Plaque
Plaster
Porridge
Potash
Poultice
Prospecting Pick
Pulverizer
Pumpkin
Quern
Raccoon
Raft
Reed
Reed basket trap
Reed chest
Resin
Resonance Archives
Resonator
Resource Crafting
Rift ward
Rock
Roofing blocks
Room
Rope
Rot
Ruin
Rusty gears
Salmon
Saltpeter
Sand
Sandbox/darce/test
Sandbox/Daretmavi/maintest
Sandbox/Tyron/Home alt
Sandbox/ZulfBracket/Home
Sandbox/ZulfBracket/Home alt
Satiety
Saw
Scrambled eggs
Scrap weapon kit
Scythe
Sea shell
Seasons
Server Config
Server startup parameters
ServerBlockTicking
Setting up a Multiplayer Server
Sewing kit
Shears
Shelf
Shield
Shovel
Sieve
Sign
Signpost
Silver
Skep
Smithing
Soil
Soil Blocks
Soup
Soybean
Spear
Steel
Steel making
Stick
Stone Blocks
Storage vessel
Straw dummy
Strewn straw
Suggestions
Sulfur
Support beam
Surface
Survival Guide - Advanced tech
Survival Guide - Your first day
Tapestry
Temperature
Template:AnimalTabs
Template:AnimalTabs/doc
Template:Armor
Template:Block
Template:Block/doc
Template:Blocks navbox
Template:Breaking
Template:Breaking/doc
Template:Climate
Template:Content
Template:Cooking navbox
Template:Cooking navbox/doc
Template:Crafting
Template:Creature
Template:Development
Template:Development/doc
Template:Drops
Template:Drops/Nothing
Template:Drops/row/doc
Template:Entities navbox
Template:Entity infobox
Template:Entity infobox/doc
Template:Farming navbox
Template:Game navbox
Template:GameVersion
Template:GameVersion/doc
Template:Item
Template:Item/doc
Template:Item/Food
Template:Item/Food/Category
Template:Item/Fuel
Template:Item/Fuel/doc
Template:Item/Smeltable
Template:Item/Transitionable
Template:Items navbox
Template:Keypress/doc
Template:Metals navbox
Template:Navbox/codemodding
Template:Navbox/contentmodding
Template:Navbox/modding
Template:Navbox/properties-audio
Template:Navbox/properties-config
Template:Navbox/properties-gameobjects
Template:Navbox/properties-patches
Template:Navbox/properties-recipes
Template:Navbox/properties-template
Template:Navbox/properties-worldgen
Template:Navbox/properties-worldproperties
Template:Needs image
Template:Outdated
Template:Outdated/doc
Template:PageOutdated
Template:Protip
Template:Protip/doc
Template:Range
Template:Range/doc
Template:Sandbox/Xandoria/Testing
Template:SectionOutdated
Template:SneakClick
Template:Spawn
Template:Spoiler
Template:Sprint
Template:Stub
Template:Stub/doc
Template:Tool
Template:Tool/MiningSpeed
Template:Using
Template:Using/doc
Template:Weapon
Template:Weapon/Attack
Temporal gear
Temporal rift
Temporal stability
Temporal storm
Terminus teleporter
Termite
Termite mound
Terrain Generation
Thatch
Tin
Titanium
Tongs
Tool rack
Tools
Tools and Weapons
Torch
Trading
Translocator
Tree
Troubleshooting Guide
Trough
Tuning cylinder
Tuning spear
Turnip
Twine
Updating Old Worlds
User:Degradkal
User:Grimdian
User:Nateonus
User:Nateonus/navbox/content
User:Nateonus/navbox/main
User:Saricane/Sandbox/Firestarter
User:Saricane/Sandbox/Test1
User:Saricane/Sandbox/Test2
User:Xandoria/Sandbox/Test1
Vegetable stew
Version history
Vertical rack
Vintage Story Original Soundtrack
Vintage Story Wiki:How to translate the wiki
Vintage Story Wiki:Translation Tables
Vintage Story Wiki:Video Tutorials Needed
VintagestoryData folder
VTML
Wallpapers
Water
Weapons
Weather
Wild food
Wild pig
Windmill
Wolf
Wooden bucket
World Configuration
World generation
Worldmap
Wrench
Zinc
Language
aa - Afar
ab - Abkhazian
abs - Ambonese Malay
ace - Achinese
ady - Adyghe
ady-cyrl - Adyghe (Cyrillic script)
aeb - Tunisian Arabic
aeb-arab - Tunisian Arabic (Arabic script)
aeb-latn - Tunisian Arabic (Latin script)
af - Afrikaans
ak - Akan
aln - Gheg Albanian
alt - Southern Altai
am - Amharic
ami - Amis
an - Aragonese
ang - Old English
anp - Angika
ar - Arabic
arc - Aramaic
arn - Mapuche
arq - Algerian Arabic
ary - Moroccan Arabic
arz - Egyptian Arabic
as - Assamese
ase - American Sign Language
ast - Asturian
atj - Atikamekw
av - Avaric
avk - Kotava
awa - Awadhi
ay - Aymara
az - Azerbaijani
azb - South Azerbaijani
ba - Bashkir
ban - Balinese
ban-bali - ᬩᬲᬩᬮᬶ
bar - Bavarian
bbc - Batak Toba
bbc-latn - Batak Toba (Latin script)
bcc - Southern Balochi
bci - Baoulé
bcl - Central Bikol
be - Belarusian
be-tarask - Belarusian (Taraškievica orthography)
bg - Bulgarian
bgn - Western Balochi
bh - Bhojpuri
bho - Bhojpuri
bi - Bislama
bjn - Banjar
blk - Pa'O
bm - Bambara
bn - Bangla
bo - Tibetan
bpy - Bishnupriya
bqi - Bakhtiari
br - Breton
brh - Brahui
bs - Bosnian
btm - Batak Mandailing
bto - Iriga Bicolano
bug - Buginese
bxr - Russia Buriat
ca - Catalan
cbk-zam - Chavacano
cdo - Min Dong Chinese
ce - Chechen
ceb - Cebuano
ch - Chamorro
cho - Choctaw
chr - Cherokee
chy - Cheyenne
ckb - Central Kurdish
co - Corsican
cps - Capiznon
cr - Cree
crh - Crimean Tatar
crh-cyrl - Crimean Tatar (Cyrillic script)
crh-latn - Crimean Tatar (Latin script)
cs - Czech
csb - Kashubian
cu - Church Slavic
cv - Chuvash
cy - Welsh
da - Danish
dag - Dagbani
de - German
de-at - Austrian German
de-ch - Swiss High German
de-formal - German (formal address)
din - Dinka
diq - Zazaki
dsb - Lower Sorbian
dtp - Central Dusun
dty - Doteli
dv - Divehi
dz - Dzongkha
ee - Ewe
egl - Emilian
el - Greek
eml - Emiliano-Romagnolo
en - English
en-ca - Canadian English
en-gb - British English
eo - Esperanto
es - Spanish
es-419 - Latin American Spanish
es-formal - Spanish (formal address)
et - Estonian
eu - Basque
ext - Extremaduran
fa - Persian
ff - Fulah
fi - Finnish
fit - Tornedalen Finnish
fj - Fijian
fo - Faroese
fon - Fon
fr - French
frc - Cajun French
frp - Arpitan
frr - Northern Frisian
fur - Friulian
fy - Western Frisian
ga - Irish
gaa - Ga
gag - Gagauz
gan - Gan Chinese
gan-hans - Gan (Simplified)
gan-hant - Gan (Traditional)
gcr - Guianan Creole
gd - Scottish Gaelic
gl - Galician
gld - Nanai
glk - Gilaki
gn - Guarani
gom - Goan Konkani
gom-deva - Goan Konkani (Devanagari script)
gom-latn - Goan Konkani (Latin script)
gor - Gorontalo
got - Gothic
grc - Ancient Greek
gsw - Swiss German
gu - Gujarati
guc - Wayuu
gur - Frafra
guw - Gun
gv - Manx
ha - Hausa
hak - Hakka Chinese
haw - Hawaiian
he - Hebrew
hi - Hindi
hif - Fiji Hindi
hif-latn - Fiji Hindi (Latin script)
hil - Hiligaynon
ho - Hiri Motu
hr - Croatian
hrx - Hunsrik
hsb - Upper Sorbian
hsn - Xiang Chinese
ht - Haitian Creole
hu - Hungarian
hu-formal - Hungarian (formal address)
hy - Armenian
hyw - Western Armenian
hz - Herero
ia - Interlingua
id - Indonesian
ie - Interlingue
ig - Igbo
ii - Sichuan Yi
ik - Inupiaq
ike-cans - Eastern Canadian (Aboriginal syllabics)
ike-latn - Eastern Canadian (Latin script)
ilo - Iloko
inh - Ingush
io - Ido
is - Icelandic
it - Italian
iu - Inuktitut
ja - Japanese
jam - Jamaican Creole English
jbo - Lojban
jut - Jutish
jv - Javanese
ka - Georgian
kaa - Kara-Kalpak
kab - Kabyle
kbd - Kabardian
kbd-cyrl - Kabardian (Cyrillic script)
kbp - Kabiye
kcg - Tyap
kea - Kabuverdianu
kg - Kongo
khw - Khowar
ki - Kikuyu
kiu - Kirmanjki
kj - Kuanyama
kjp - Eastern Pwo
kk - Kazakh
kk-arab - Kazakh (Arabic script)
kk-cn - Kazakh (China)
kk-cyrl - Kazakh (Cyrillic script)
kk-kz - Kazakh (Kazakhstan)
kk-latn - Kazakh (Latin script)
kk-tr - Kazakh (Turkey)
kl - Kalaallisut
km - Khmer
kn - Kannada
ko - Korean
ko-kp - Korean (North Korea)
koi - Komi-Permyak
kr - Kanuri
krc - Karachay-Balkar
kri - Krio
krj - Kinaray-a
krl - Karelian
ks - Kashmiri
ks-arab - Kashmiri (Arabic script)
ks-deva - Kashmiri (Devanagari script)
ksh - Colognian
ksw - S'gaw Karen
ku - Kurdish
ku-arab - Kurdish (Arabic script)
ku-latn - Kurdish (Latin script)
kum - Kumyk
kv - Komi
kw - Cornish
ky - Kyrgyz
la - Latin
lad - Ladino
lb - Luxembourgish
lbe - Lak
lez - Lezghian
lfn - Lingua Franca Nova
lg - Ganda
li - Limburgish
lij - Ligurian
liv - Livonian
lki - Laki
lld - Ladin
lmo - Lombard
ln - Lingala
lo - Lao
loz - Lozi
lrc - Northern Luri
lt - Lithuanian
ltg - Latgalian
lus - Mizo
luz - Southern Luri
lv - Latvian
lzh - Literary Chinese
lzz - Laz
mad - Madurese
mai - Maithili
map-bms - Basa Banyumasan
mdf - Moksha
mg - Malagasy
mh - Marshallese
mhr - Eastern Mari
mi - Maori
min - Minangkabau
mk - Macedonian
ml - Malayalam
mn - Mongolian
mni - Manipuri
mnw - Mon
mo - Moldovan
mr - Marathi
mrh - Mara
mrj - Western Mari
ms - Malay
ms-arab - Malay (Jawi script)
mt - Maltese
mus - Muscogee
mwl - Mirandese
my - Burmese
myv - Erzya
mzn - Mazanderani
na - Nauru
nah - Nāhuatl
nan - Min Nan Chinese
nap - Neapolitan
nb - Norwegian Bokmål
nds - Low German
nds-nl - Low Saxon
ne - Nepali
new - Newari
ng - Ndonga
nia - Nias
niu - Niuean
nl - Dutch
nl-informal - Dutch (informal address)
nmz - Nawdm
nn - Norwegian Nynorsk
no - Norwegian
nod - Northern Thai
nov - Novial
nqo - N’Ko
nrm - Norman
nso - Northern Sotho
nv - Navajo
ny - Nyanja
nyn - Nyankole
nys - Nyungar
oc - Occitan
ojb - Northwestern Ojibwe
olo - Livvi-Karelian
om - Oromo
or - Odia
os - Ossetic
pa - Punjabi
pag - Pangasinan
pam - Pampanga
pap - Papiamento
pcd - Picard
pdc - Pennsylvania German
pdt - Plautdietsch
pfl - Palatine German
pi - Pali
pih - Norfuk / Pitkern
pl - Polish
pms - Piedmontese
pnb - Western Punjabi
pnt - Pontic
prg - Prussian
ps - Pashto
pt - Portuguese
pt-br - Brazilian Portuguese
pwn - Paiwan
qqq - Message documentation
qu - Quechua
qug - Chimborazo Highland Quichua
rgn - Romagnol
rif - Riffian
rm - Romansh
rmc - Carpathian Romani
rmy - Vlax Romani
rn - Rundi
ro - Romanian
roa-tara - Tarantino
rsk - руски
ru - Russian
rue - Rusyn
rup - Aromanian
ruq - Megleno-Romanian
ruq-cyrl - Megleno-Romanian (Cyrillic script)
ruq-latn - Megleno-Romanian (Latin script)
rw - Kinyarwanda
sa - Sanskrit
sah - Sakha
sat - Santali
sc - Sardinian
scn - Sicilian
sco - Scots
sd - Sindhi
sdc - Sassarese Sardinian
sdh - Southern Kurdish
se - Northern Sami
se-fi - davvisámegiella (Suoma bealde)
se-no - davvisámegiella (Norgga bealde)
se-se - davvisámegiella (Ruoŧa bealde)
sei - Seri
ses - Koyraboro Senni
sg - Sango
sgs - Samogitian
sh - Serbo-Croatian
shi - Tachelhit
shi-latn - Tachelhit (Latin script)
shi-tfng - Tachelhit (Tifinagh script)
shn - Shan
shy - Shawiya
shy-latn - Shawiya (Latin script)
si - Sinhala
simple - Simple English
sjd - Kildin Sami
sje - Pite Sami
sk - Slovak
skr - Saraiki
skr-arab - Saraiki (Arabic script)
sl - Slovenian
sli - Lower Silesian
sm - Samoan
sma - Southern Sami
smn - Inari Sami
sms - Skolt Sami
sn - Shona
so - Somali
sq - Albanian
sr - Serbian
sr-ec - Serbian (Cyrillic script)
sr-el - Serbian (Latin script)
srn - Sranan Tongo
ss - Swati
st - Southern Sotho
stq - Saterland Frisian
sty - Siberian Tatar
su - Sundanese
sv - Swedish
sw - Swahili
szl - Silesian
szy - Sakizaya
ta - Tamil
tay - Tayal
tcy - Tulu
te - Telugu
tet - Tetum
tg - Tajik
tg-cyrl - Tajik (Cyrillic script)
tg-latn - Tajik (Latin script)
th - Thai
ti - Tigrinya
tk - Turkmen
tl - Tagalog
tly - Talysh
tly-cyrl - толыши
tn - Tswana
to - Tongan
tpi - Tok Pisin
tr - Turkish
tru - Turoyo
trv - Taroko
ts - Tsonga
tt - Tatar
tt-cyrl - Tatar (Cyrillic script)
tt-latn - Tatar (Latin script)
tum - Tumbuka
tw - Twi
ty - Tahitian
tyv - Tuvinian
tzm - Central Atlas Tamazight
udm - Udmurt
ug - Uyghur
ug-arab - Uyghur (Arabic script)
ug-latn - Uyghur (Latin script)
uk - Ukrainian
ur - Urdu
uz - Uzbek
uz-cyrl - Uzbek (Cyrillic script)
uz-latn - Uzbek (Latin script)
ve - Venda
vec - Venetian
vep - Veps
vi - Vietnamese
vls - West Flemish
vmf - Main-Franconian
vmw - Makhuwa
vo - Volapük
vot - Votic
vro - Võro
wa - Walloon
war - Waray
wls - Wallisian
wo - Wolof
wuu - Wu Chinese
xal - Kalmyk
xh - Xhosa
xmf - Mingrelian
xsy - Saisiyat
yi - Yiddish
yo - Yoruba
yrl - Nheengatu
yue - Cantonese
za - Zhuang
zea - Zeelandic
zgh - Standard Moroccan Tamazight
zh - Chinese
zh-cn - Chinese (China)
zh-hans - Simplified Chinese
zh-hant - Traditional Chinese
zh-hk - Chinese (Hong Kong)
zh-mo - Chinese (Macau)
zh-my - Chinese (Malaysia)
zh-sg - Chinese (Singapore)
zh-tw - Chinese (Taiwan)
zu - Zulu
Format
Export for off-line translation
Export in native format
Fetch
<languages/>{{GameVersion|1.15}} __FORCETOC__ This article requires a setup development environment. If you don't have one, read the tutorial on [https://wiki.vintagestory.at/index.php?title=Modding:Setting_up_your_Development_Environment setting up your development environment.] For brevity, this article presupposes some familiarity with VintageStory code modding, primarily [https://wiki.vintagestory.at/index.php?title=Modding:Mod_Packaging how mods are packaged] and [https://wiki.vintagestory.at/index.php?title=Modding:Setting_up_your_Development_Environment#Project_Setup_.28Compiled_Zip.29 how to setup a compiled mod project.] If you are looking to create your first code mod, we recommend starting [https://wiki.vintagestory.at/index.php?title=Modding:Advanced_Blocks here] instead. == Introduction == VintageStory makes all loaded mods available through it's expansive API, which you can explore in [http://apidocs.vintagestory.at/api/Vintagestory.API.Common.ICoreAPI.html the API docs.] This makes it possible for code mods to interact with each other and access each other's public properties. It does, however, make whatever mod is including another mod dependent on that mod. If the mod being included is not present or disabled, the including mod will not work. The loading and retrieving of mods is done through the [http://apidocs.vintagestory.at/api/Vintagestory.API.Common.IModLoader.html <code>IModLoader</code>], which we retrieve from [http://apidocs.vintagestory.at/api/Vintagestory.API.Common.ICoreAPI.html <code>ICoreAPI</code>]. We can retrieve both the full [http://apidocs.vintagestory.at/api/Vintagestory.API.Common.Mod.html <code>Mod</code>], with all it's useful data, as well as it's contained [http://apidocs.vintagestory.at/api/Vintagestory.API.Common.ModSystem.html <code>ModSystems</code>]. This is superbly useful in multiple scenarios, for example - * Splitting up a large mod into smaller logical parts that communicate - a modpack. * Extendable mods, for example - the creative GUI tool for growing trees, which lets you register new tree types and easily test them. In this article, we will be creating two mods. Our first mod will provide a method for our second mod to interact with. We will demonstrate the use of the <code>ModLoader</code> and also explain how to reference an external mod and have that reference resolve at game runtime. <small>Note that, excluding the use of reflection or the use of an intermediary library, which is outside the scope of this article, <b>only compiled mods can interact with eachother</b>.</small> == TipMod & SpawnMod == The two mods we will be creating are named "TipMod" and "SpawnMod". * "TipMod" will store useful gameplay tips and periodically print them in chat. It will also provide a method which other mods can use to add their own tips. * "SpawnMod" will register a command which teleports the player to his set or default spawnpoint. It will also access "TipMod" and add it's own tips about the command. == Preparation == We start by setting up two empty mods, "TipMod" and "SpawnMod". In each mod, we add a new *.cs source file - we will be naming these files <code>TipMod.cs</code> and <code>SpawnMod.cs</code> respectively. In our .cs files, we do the following: * Add the necessary <code>using</code> directives. * Create a class named after the mod it's contained in - <code>TipMod</code> and <code>SpawnMod</code>. * Have our classes inherit <code>ModSystem</code> - the base for any VintageStory code mod. * Override the <code>StartServerSide</code> method to access [http://apidocs.vintagestory.at/api/Vintagestory.API.Common.ICoreServerAPI.html <code>ICoreServerAPI</code>]. * Make the <code>TipMod</code> class <code>public</code> so that it's accessible by other mods. <syntaxhighlight lang="c#"> // In TipMod.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Vintagestory.API.Common; using Vintagestory.API.Server; namespace tipmod.src { public class TipMod : ModSystem { public override void StartServerSide(ICoreServerAPI api) { base.StartServerSide(api); } } } </syntaxhighlight> <syntaxhighlight lang="c#"> // In SpawnMod.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Vintagestory.API.Common; using Vintagestory.API.Server; namespace spawnmod.src { class SpawnMod : ModSystem { public override void StartServerSide(ICoreServerAPI api) { base.StartServerSide(api); } } } </syntaxhighlight> This concludes setting up the basis of our mods. Lastly, in "TipMod", we create an additional file called <code>Tip.cs</code>, where we will define the data structure for tips, called <code>Tip</code>. <syntaxhighlight lang="c#"> // In Tip.cs using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace tipmod.src { public class Tip { string author; string tip; public Tip(string author, string tip) { this.author = author; this.tip = tip; } public override string ToString() { return "Tip by \"" + author + "\": " + tip; } } } </syntaxhighlight> Our resulting folder structure looks like this. [[File:ModdableModFolderStructure.png|none]] We are now ready to extend our mods, starting with "TipMod" - our moddable mod. == Setting up TipMod == For "TipMod", we do the following: * Store the <code>ICoreServerAPI</code> object as a field so that we can access it throughout our class. * Define a <code>List</code> that stores <code>Tip</code> objects. * Define a method that selects a random <code>Tip</code> from the <code>List</code> and prints it in chat for all players, printing a default message if the <code>List</code> is empty. * Register that method to be called at set intervals by the [http://apidocs.vintagestory.at/api/Vintagestory.API.Server.IServerEventAPI.html#Vintagestory_API_Server_IServerEventAPI_Timer_Vintagestory_API_Common_Action_System_Double_ <code>Timer</code>], which is available in the [http://apidocs.vintagestory.at/api/Vintagestory.API.Server.IServerEventAPI.html <code>IServerEventAPI</code>]. * Define a <code>public</code> method for adding new <code>Tip</code> objects. <syntaxhighlight lang="c#"> // In TipMod.cs public class TipMod : ModSystem { ICoreServerAPI api; List<Tip> tips = new List<Tip>(); double tipInterval = 10; public override void StartServerSide(ICoreServerAPI api) { base.StartServerSide(api); this.api = api; api.Event.Timer(OnInterval, tipInterval); } private void OnInterval() { int tipCount = tips.Count(); string message = "There aren't any listed tips"; if (tipCount > 0) { // Select a random number in the range of [0-1] double random = api.World.Rand.NextDouble(); // Make the number relative to the size of our tips list int randomTip = (int)Math.Floor(random * tipCount); Tip tip = tips[randomTip]; message = tip.ToString(); } api.SendMessageToGroup(GlobalConstants.GeneralChatGroup, message, EnumChatType.AllGroups); } public void AddTip(Tip tip) { tips.Add(tip); } } </syntaxhighlight> For testing purposes, we set the interval to be very short (10 seconds). Feel free to change this accordingly. Remember, both <b>classes and methods which other mods will interact with have to be declared <code>public</code>.</b> In C#, classes and methods are not public by default. You can [https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers read more about this here.] We can now compile our mod, add it to our VintageStory mod folder and test it ingame. If the there are occasional chat messages saying "There aren't any listed tips", our mod is working. We are ready to move on to the next step - setting up "SpawnMod" and then having it interact with "TipMod". == Setting up SpawnMod == Let's first setup our mods functionality. We register a command which teleports the player to spawn. Conveniently, the [http://apidocs.vintagestory.at/api/Vintagestory.API.Server.IServerPlayer.html <code>IServerPlayer</code>] object stores it's spawn position, as well as the [http://apidocs.vintagestory.at/api/Vintagestory.API.Common.IPlayer.html#Vintagestory_API_Common_IPlayer_Entity <code>IPlayerEntity</code>], which defines a method for teleporting itself to a location. <syntaxhighlight lang="c#"> // In SpawnMod.cs class SpawnMod : ModSystem { public override void StartServerSide(ICoreServerAPI api) { base.StartServerSide(api); api.RegisterCommand("spawn", "Teleport to spawn", "", OnCmdSpawn); } private void OnCmdSpawn(IServerPlayer player, int groupId, CmdArgs args) { player.Entity.TeleportTo(player.SpawnPosition); } } </syntaxhighlight> "SpawnMod" is ready. Let's test it. The command <code>/spawn</code> should now teleport us to spawn. If our mods are working, we're ready to make "SpawnMod" interact with "TipMod". == Mods interacting == Before we get started, we have to add a reference in "SpawnMod" to "TipMod". === Adding a reference to an external mod === If you are using Visual Studio, in your Solution Explorer, directly under your project, right-click "References" and select "Add Reference". [[File:ADDINGAREFERENCERIGHTCLICK.png|none]] Here we locate either the "TipMod" project or the compiled .dll file, and add it. [[File:FindingReference.png|none]] After adding the reference, make sure it is not copying the file to the output folder when compiling - having multiple .dll files with <code>ModSystems</code> in them will break your mod. [[File:SettingCopyLocalToFalse.png|none]] === Accessing the ModLoader === Now we're ready to have "SpawnMod" add tips. Let's go ahead and do the following. * Add a <code>using</code> directive for the namespace <code>tipmod.src</code>. * Retrieve <code>TipMod</code> through the <code>ModLoader</code> by passing it's type. * Call the <code>AddTip</code> method provided by <code>TipMod</code> and add a variety of tips. <syntaxhighlight lang="c#"> public override void StartServerSide(ICoreServerAPI api) { base.StartServerSide(api); api.RegisterCommand("spawn", "Teleport to spawn", "", OnCmdSpawn); using tipmod.src; TipMod tipMod = api.ModLoader.GetModSystem<TipMod>(); tipMod.AddTip(new Tip("codemeister32", "To quickly return to spawn, type /spawn")); tipMod.AddTip(new Tip("codemeister32", "Can't find your way home? Type /spawn")); tipMod.AddTip(new Tip("codemeister32", "Being chased by wolves? Quick, type /spawn")); } </syntaxhighlight> == Conclusion == Following the steps in this article, this is what our resulting code looks like, spread across two mods. <syntaxhighlight lang="c#"> // In TipMod.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Vintagestory.API.Common; using Vintagestory.API.Config; using Vintagestory.API.Server; namespace tipmod.src { public class TipMod : ModSystem { ICoreServerAPI api; List<Tip> tips = new List<Tip>(); double tipInterval = 10; public override void StartServerSide(ICoreServerAPI api) { base.StartServerSide(api); this.api = api; api.Event.Timer(OnInterval, tipInterval); } private void OnInterval() { int tipCount = tips.Count(); string message = "There aren't any listed tips"; if (tipCount > 0) { // Select a random number in the range of [0-1] double random = api.World.Rand.NextDouble(); // Make the number relative to the size of our tips list int randomTip = (int)Math.Floor(random * tipCount); Tip tip = tips[randomTip]; message = tip.ToString(); } api.SendMessageToGroup(GlobalConstants.GeneralChatGroup, message, EnumChatType.AllGroups); } public void AddTip(Tip tip) { tips.Add(tip); } } } </syntaxhighlight> <syntaxhighlight lang="c#"> // In Tip.cs using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace tipmod.src { public class Tip { string author; string tip; public Tip(string author, string tip) { this.author = author; this.tip = tip; } public override string ToString() { return "Tip by \"" + author + "\": " + tip; } } } </syntaxhighlight> <syntaxhighlight lang="c#"> // In SpawnMod.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Vintagestory.API.Common; using Vintagestory.API.Server; using tipmod.src; namespace spawnmod.src { class SpawnMod : ModSystem { public override void StartServerSide(ICoreServerAPI api) { base.StartServerSide(api); api.RegisterCommand("spawn", "Teleport to spawn", "", OnCmdSpawn); TipMod tipMod = api.ModLoader.GetModSystem<TipMod>(); tipMod.AddTip(new Tip("codemeister32", "To quickly return to spawn, type /spawn")); tipMod.AddTip(new Tip("codemeister32", "Can't find your way home? Type /spawn")); tipMod.AddTip(new Tip("codemeister32", "Being chased by wolves? Quick, type /spawn")); } private void OnCmdSpawn(IServerPlayer player, int groupId, CmdArgs args) { player.Entity.TeleportTo(player.SpawnPosition); } } } </syntaxhighlight> We're now ready to test our mods to see if they're interacting successfully. After placing both our compiled mods in the mods folder and booting into a world, we should see a random tip pop up in the chat every 10 seconds. [[File:ModdableModSuccess.png|none]] If so, well done! You've successfully followed the article and have created a moddable mod. == Troubleshooting == If you've ran into problems setting up either mod, check the error logs located at <code>VintagestoryData/Logs</code> in <code>server-main.txt</code>. Possible causes for either mod not working: * It's a .cs (source) mod and not a .dll (compiled) mod. Refer here [https://wiki.vintagestory.at/index.php?title=Modding:Setting_up_your_Development_Environment#Set_Mod for how to set a compiled mod.] * It's missing <code>modinfo.json</code>. * Your version of VintageStory is outdated. * You have multiple .dll files containing <code>ModSystems</code> in your mod folder. * The referenced mod, "TipMod", is not present in the mod folder. == Distribution == To distribute this mod, run the following command in the vsmodtools cli <code>pack <your mod id></code>, then copy the .zip file into your VintageStory mods folder. Here are the official versions: * for VS v1.13.2: [https://wiki.vintagestory.at/index.php?title=File:TipMod_vs1.13.2_v1.0.0.zip TipMod_vs1.13.2_v1.0.0.zip] and [https://wiki.vintagestory.at/index.php?title=File:SpawnMod_vs1.13.2_v1.0.0.zip SpawnMod_vs1.13.2_v1.0.0.zip]. {{Navbox/modding|Vintage Story}}
Navigation
Navigation
Main page
Recent changes
Random page
VS related links
Website
Discord
Forum
Devlog
VS ModDB
Community portal
Noticeboard
Editing the wiki
Translating the wiki
Help about MediaWiki
Wiki tools
Wiki tools
Special pages
Page tools
Page tools
User page tools
More
Translate
Printable version