Skip to content

nautil-mc

SurenaStudio's avatar

nautil-mc

by Surena Studio

Terminal window
pip install nautil-mc
# import actions using (even if your IDE says it is unused):
import nautil_mc.actions

dat_set Experimental

Section titled “dat_set ”
  • file: PathLike Templated
    The path to the NBT file to modify, relative to the artifact.
  • key: str Templated
    The NBT path to the value to set, for example “Data.LevelName” or “Data.Player.Inventory[0].id”.
  • value: Any Templated*
    The value to set, which will be converted to an appropriate NBT tag. You can also pass nbtlib tag instances directly if you want more control over the types.
    Templated if a str is passed.

Sets a value in a NBT file. Can be .dat or any other NBT-formatted file.

a = Artifact(env).use(...)\
.dat_set("level.dat", "Data.allowCommands", False)

  • zip: bool = True
    Whether to format datapacks in a zip format (true) or folder format (false).

Uniformly format datapacks in a zip or folder format.

a = Artifact(env).use(...)\
.datapacks_zip_format(zip=True)

  • name: str Templated
    The new name for the world, which will be set in the “level.dat” file.
  • file: PathLike = "level.dat" Templated
    The path to the “level.dat” file to modify, relative to the artifact.

Renames a Minecraft world by setting the “Data.LevelName” field in the specified “level.dat” file.

a = Artifact(env).use(...)\
.level_rename("A map named using Nautil!")

  • player: str Templated
    The player for whom to set the scoreboard value.
  • objective: str Templated
    The path to the “level.dat” file to modify, relative to the artifact.
  • value: int | str Templated*
    The value to set for the scoreboard entry.
    Templated if a str is passed. But will be casted to an int after rendering.

Set a scoreboard value for a player and a given objective. Creates the objective if it doesn’t exist.

a = Artifact(env).use(...)\
.scoreboard_set("nautil.build", "?builtWithNautil", 1)

storage_set Experimental

Section titled “storage_set ”
  • storage: str Templated
    The storage namespaced identifier. For example, “nautil:build”. if the namespace is omitted, “minecraft” will be used by default.
  • path: str | nbtlib.Path Templated*
    The key path within the storage. Supports both string paths like “foo.bar[0].baz”.
    Templated if a str is passed.
  • value: Any Templated*
    The value to set for the storage entry.
    Templated if a str is passed.

Set a storage value for a given storage and path. Creates the data storage if it doesn’t exist.

a = Artifact(env).use(...)\
.storage_set("nautil:build", "built_with_nautil", True)