feat: add initial People Playground mod development kit

This commit is contained in:
2026-01-06 06:35:51 +03:00
parent b89c805060
commit 566791ce62
1095 changed files with 40280 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
URL: https://wiki.studiominus.nl/snippets/registerItem.html
Title: People Playground Modding - Registering an item
==================================================
Registering an item
This code snippet shows a simple template of a ModAPI.Register call.
// register item to the mod api
ModAPI.Register(
new Modification()
{
OriginalItem = ModAPI.FindSpawnable("Knife"), //item to derive from
NameOverride = "Dagger -MoreMelee", //new item name with a suffix to assure it is globally unique
DescriptionOverride = "It is a dagger.", //new item description
CategoryOverride = ModAPI.FindCategory("Melee"), //new item category
ThumbnailOverride = ModAPI.LoadSprite("daggerView.png"), //new item thumbnail (relative path)
AfterSpawn = (Instance) => //all code in the AfterSpawn delegate will be executed when the item is spawned
{
//get the SpriteRenderer and replace its sprite with a custom one
Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("dagger.png");
}
}
);