Mods / ExtraCode

Tags: #Library #QoL
Author: jayu
Side: Both
Created: Sep 24th 2024 at 5:12 PM
Last modified: Apr 16th at 1:46 AM
Downloads: 599
Follow Unfollow 23

Latest release (for outdated Vintage Story v1.20.7):
extracode_1.4.0.zip  1-click install


Buy Me a Coffee at ko-fi.com

This mod is a library and adds no content to the game

This mod's purpose is to make content modder's lives easier by providing a set of very moddable classes and behaviours, with focus on flexibility. Please do offer suggestions on what your needs are, especially things that could make it easier to implement hardcoded vanilla stuff.

Please check the example mod for usage. I won't write documentation for now, so an example mod is a great solution because it is what I use for testing, allowing me to use it both to test and as an example for users.

How to use

You have two options:

  • Use this mod as a dependency by listing it in the modinfo and require players to download it (preferred)
  • For a more compact installation, copy the dll of this mod into your mod zip folder (could be redundant or cause issues if the player or server has more mods installed that use this)

Both methods are compatible with servers as the mod will be downloaded automatically if it's installed on a server.

Currently available classes

  • [Block Behaviour] BreakSpawner: Spawn entities when broken, allows to configure multiple entity codes, set their relative chances, or a required tool for the effect to be in place (allows wildcards selectors). Check example mod for usage.
  • [Block Behaviour] InfestedBlock: Inherits from BreakSpawner, resembles minecraft's infested rock by breaking the block when a connected infested block is broken. Allows wildcards selectors for what nearby infested blocks will trigger the effect. Break delay for each block can be set.
  • [Block Behaviour] DropsWhenBrokenWith: Allows to set multiple custom drops based on the tool used to break the block (allows wildcards).
  • [Block Behaviour] CustomDrinkSpeed: Allows to set custom drink speed for containers.
  • [Item] ItemMetalBloom: Generic metal bloom item, to make items like irom blooms that need to be smithed on an anvil to refine

Additionally the current attributes exist

  • "blisterSteelLike": ingot will behave like blister steel when placed on an anvil to be worked when this attribute is set to true.

  • "maxContainerCapacityLitres": attribute for blocks that use the fruitpress class, allows to configure the maximum capacity a container can have to be placed under it

Additional tweaks

  • Can define metal worldproperties (still need to be called block/metal) in any custom domain (this feature is vanilla in 1.20), can also json patch vanilla metal worldproperties, which is impossible in vanilla since they load before patches (not strictly needed because of the first)

Used in

image

Bartender

Adds Bartender with his beach bar to your world

image

Fruitpress Patch

Fixes the fruitpress not allowing liquid containers larger than 20L

More modding tools and libraries

image

VTML Editor

Edit VTML in-game

image

Vintage Mod Templates [Code][Content]

Custom templates for code and content mods

image

BlockPatch Patcher

Dynamically patch block patches. Allows wildcards and multiplication of values.

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v1.4.0 160 Apr 16th at 1:46 AM Show extracode_1.4.0.zip 1-click install
v1.3.0 39 Mar 18th at 1:27 PM Show extracode_1.3.0.zip 1-click install
v1.2.1 25 Mar 14th at 1:28 AM Show extracode_1.2.1.zip 1-click install
v1.2.0 112 Oct 23rd 2024 at 8:30 PM Show ExtraCode.dll 1-click install
v1.1.1 86 Oct 17th 2024 at 1:49 PM Show ExtraCode.dll 1-click install
v1.1.0 76 Oct 16th 2024 at 10:28 PM Show ExtraCode.dll 1-click install
v1.0.0 100 Sep 24th 2024 at 5:43 PM Show ExtraCode.dll 1-click install

6 Comments (oldest first | newest first)

💬 Pocket_Equine, Mar 22nd at 12:08 AM

Thank you!!

{
code: "player",
class: "EntityPlayer",
weight: 65,
canClimb: true,
climbTouchDistance: 0.5,
hitboxSize: { x: 0.6, y: 0.65 },
eyeHeight: 1.7,
attributes: {

Changed y: from 1.65 to 0.65 an its perfect.
You're an angel.

💬 Pocket_Equine, Mar 21st at 9:27 PM

@Jayu
Thank you again for the help I appreciate it! I'll root around in the player Json a little

💬 jayu , Mar 21st at 1:48 PM

Pocket_Equine I believe that can be done in the player entity json, but I have never done that before. By looking at assets/game/entities/humanoid/player.json, it seems like you would want to change the y value in hitboxSize, so you would need a patch:

[
{
"op": "replace",
"path": "/hitboxSize/y",
"value": 1.0,
"file": "game:entities/humanoid/player.json"
}
]

However, I do not know if this would be enough. I'm sure if you ask on the VS Discord people will be happy to give you more guidance.

💬 Pocket_Equine, Mar 21st at 1:00 PM

Hallo!
Sorry to bring this up here but do you know of any mods that adjust the player collision to 1 block?
I am kinda playin a dwarf

💬 jayu , Mar 18th at 2:37 PM

MoonlitShade hey did you ever get around to using this?

💬 MoonlitShade, Sep 24th 2024 at 5:56 PM

Thanks for making my suggestions a reality! I have plans for this :P

 (edit comment delete)