SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
Back to NxLabs

NxLabs / Vintage Story

Catch and Release LIB

MBy MortalityGames

Shared library for Catch and Release mods.

Description

<p>Shared library for <a href="https://mods.vintagestory.at/crbutterflies"><span style="color: #3598db; --darkreader-inline-color: var(--darkreader-text-3598db, #46a1de);" data-darkreader-inline-color="">Catch and Release: Butterflies</span></a> and <span style="color: #3598db; --darkreader-inline-color: var(--darkreader-text-3598db, #46a1de);" data-darkreader-inline-color=""><a style="color: #3598db; --darkreader-inline-color: var(--darkreader-text-3598db, #46a1de);" href="https://mods.vintagestory.at/crfish" data-darkreader-inline-color="">Catch and Release: Fish</a></span>.</p> <p>Contains common code for "cages" and storing creatures within those cages.</p> <p><img src="https://moddbcdn.vintagestory.at/Display_aa0c42d43a5f1f06c5117fb956a2884d.png" alt="image" width="378" height="208">&nbsp; &nbsp; <img src="https://moddbcdn.vintagestory.at/2026-07-05_11-12-08_c8f60ac520577a5a86bed2c78727543b.png" alt="" width="400" height="207"></p> <p>&nbsp;</p> <p><a href="https://ko-fi.com/mortalitygames"><img src="https://i.ibb.co/mFtHctqV/Kofi-Banner.png" alt="" width="301" height="139"></a></p> <p>&nbsp;</p> <hr style="size: 5px;"> <h2><span style="color: #e03e2d;" data-darkreader-inline-color="">Below is for modders who want to extend the mod or create their own caged creatures</span></h2> <p>&nbsp;</p> <p><strong>TODO:</strong> Documentation on API. If anyone is interested in using this for further mods, come and discuss in <a href="https://discord.com/channels/302152934249070593/1476930968085463122"><em>Catch and Release post in the VS Discord.</em></a></p> <h2>Example how to setup new cages:</h2> <ol start="1"> <li>Create shape + animations for caged creature entities</li> <li>Entity definition for caged creature(s). Including:</li> </ol> <div class="spoiler"> <div class="spoiler-toggle">Caged creature behaviour snipped</div> <div class="spoiler-text">behaviors: [<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; code: "taskai",<br>&nbsp; &nbsp; &nbsp; &nbsp; aitasks: [{<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; code: "crlib.CreatureCaged",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; priority: 0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; movespeed: 0.6,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;- How fast caged creature moves<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; turnspeed: 2.5,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;- How fast caged creature turns to target position<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; moveAnim: "fly", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;- Name of animation for when moving<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; restAnim: "feed",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;- Name of animation for when sleeping<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; restTime: "Day",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;- Creature sleeps during "Day" "Night" or "None" (to not rest)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; restDaylightLevel: 0.7,&nbsp; &nbsp;&lt;- Daylight amount to trigger sleeping (basically, time of day)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; groundOnRest: true&nbsp; &nbsp; &nbsp; &nbsp;&lt;- When resting, does the creature find the ground first<br>&nbsp; &nbsp; &nbsp; &nbsp; }]<br>&nbsp; &nbsp; }<br>]</div> </div> <ol start="3"> <li>Shape for your cage(s) (plus textures if needed)</li> <li>Custom cage block(s). Including:</li> </ol> <div class="spoiler"> <div class="spoiler-toggle">Cage config attribute</div> <div class="spoiler-text">attributes: {<br>&nbsp; &nbsp; cageConfig: {<br>&nbsp; &nbsp; &nbsp; &nbsp; cageName: "crbutterfly:cage_name",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;- Just some display test when refering to this type of cage<br>&nbsp; &nbsp; &nbsp; &nbsp; fits: 4,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;- How many creatures fit in the cage<br>&nbsp; &nbsp; &nbsp; &nbsp; radius: 0.3,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;- Size of the cage (for the purpose of determining creatures walking around)<br>&nbsp; &nbsp; &nbsp; &nbsp; height: 0.5,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;- Height of the cage (for the purpose of flying creatures - 0 for walking creatures)<br>&nbsp; &nbsp; &nbsp; &nbsp; bottom: 0.05,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;- Offset the 'floor' of the cage<br>&nbsp; &nbsp; &nbsp; &nbsp; validItems: "game:creature-butterfly-*",&nbsp; &nbsp; &nbsp; &nbsp;&lt;- What creature items can be placed in the cage<br>&nbsp; &nbsp; &nbsp; &nbsp; dropsEntity: "game:butterfly-",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;- What creature items fall out of a broken cage<br>&nbsp; &nbsp; &nbsp; &nbsp; spawnEntity: "crbutterfly:cagedbutterfly-",&nbsp; &nbsp;&lt;- What creature entities 'wander' in the cage<br>&nbsp; &nbsp; &nbsp; &nbsp; displays: 1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;- How many items to display in a cage<br>&nbsp; &nbsp; },<br>}</div> </div> <ol start="5"> <li>Recipe(s) for cage(s)</li></ol>

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.