nautil-mc
Installation
Section titled “Installation”pip install nautil-mcActions
Section titled “Actions”# import actions using (even if your IDE says it is unused):import nautil_mc.actionsdat_set Experimental
Section titled “dat_set ”Parameters
Section titled “Parameters”file: PathLikeTemplated
The path to the NBT file to modify, relative to the artifact.key: strTemplated
The NBT path to the value to set, for example “Data.LevelName” or “Data.Player.Inventory[0].id”.value: AnyTemplated*
The value to set, which will be converted to an appropriate NBT tag. You can also passnbtlibtag instances directly if you want more control over the types.
Templated if astris passed.
Description
Section titled “Description”Sets a value in a NBT file. Can be .dat or any other NBT-formatted file.
Example
Section titled “Example”a = Artifact(env).use(...)\ .dat_set("level.dat", "Data.allowCommands", False)datapacks_zip_format
Section titled “datapacks_zip_format”Parameters
Section titled “Parameters”zip: bool = True
Whether to format datapacks in a zip format (true) or folder format (false).
Description
Section titled “Description”Uniformly format datapacks in a zip or folder format.
Example
Section titled “Example”a = Artifact(env).use(...)\ .datapacks_zip_format(zip=True)level_rename
Section titled “level_rename”Parameters
Section titled “Parameters”name: strTemplated
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.
Description
Section titled “Description”Renames a Minecraft world by setting the “Data.LevelName” field in the specified “level.dat” file.
Example
Section titled “Example”a = Artifact(env).use(...)\ .level_rename("A map named using Nautil!")scoreboard_set
Section titled “scoreboard_set”Parameters
Section titled “Parameters”player: strTemplated
The player for whom to set the scoreboard value.objective: strTemplated
The path to the “level.dat” file to modify, relative to the artifact.value: int | strTemplated*
The value to set for the scoreboard entry.
Templated if astris passed. But will be casted to anintafter rendering.
Description
Section titled “Description”Set a scoreboard value for a player and a given objective. Creates the objective if it doesn’t exist.
Example
Section titled “Example”a = Artifact(env).use(...)\ .scoreboard_set("nautil.build", "?builtWithNautil", 1)storage_set Experimental
Section titled “storage_set ”Parameters
Section titled “Parameters”storage: strTemplated
The storage namespaced identifier. For example, “nautil:build”. if the namespace is omitted, “minecraft” will be used by default.path: str | nbtlib.PathTemplated*
The key path within the storage. Supports both string paths like “foo.bar[0].baz”.
Templated if astris passed.value: AnyTemplated*
The value to set for the storage entry.
Templated if astris passed.
Description
Section titled “Description”Set a storage value for a given storage and path. Creates the data storage if it doesn’t exist.
Example
Section titled “Example”a = Artifact(env).use(...)\ .storage_set("nautil:build", "built_with_nautil", True)