Modding:Chunk Moddata: Difference between revisions

From Vintage Story Wiki
m
m (VeryGoodDog moved page Chunk Data Storage to Modding:Chunk Data Storage)
(2 intermediate revisions by one other user not shown)
Line 196: Line 196:
             foreach (KeyValuePair<IServerChunk, int> chunk in hauntedChunks)
             foreach (KeyValuePair<IServerChunk, int> chunk in hauntedChunks)
             {
             {
                if(chunk.Value == 0) continue;
                 chunk.Key.SetServerModdata("haunting", SerializerUtil.Serialize(chunk.Value));
                 chunk.Key.SetServerModdata("haunting", SerializerUtil.Serialize(chunk.Value));
             }
             }
Line 247: Line 248:
}
}
</syntaxhighlight>
</syntaxhighlight>
== Testing ==
Let's run the mod now! Once you're ingame, enter the command /kill. From now on, you will receive 1 damage every time you sleep in the chunk you died in.
== Distribution ==
To distribute this mod, you may run the following command in the modtools 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.12.14: [https://wiki.vintagestory.at/index.php?title=File:HauntedChunks_vs1.12.14_v1.0.0.zip HauntedChunks_vs1.12.14_v1.0.0.zip]
{{Navbox/modding|Vintage Story}}
Confirmedusers, Bureaucrats, editor, Administrators
1,522

edits