Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 1.08 KB

File metadata and controls

48 lines (33 loc) · 1.08 KB

Settings API

Use the settings namespace to get/set/toggle/reset Baritone settings cleanly.

When to use this

  • You want typed-looking access like client.settings.allowPlace.
  • You need to modify settings before pathing commands.

Example

import asyncio
from pyritone import Client


async def main() -> None:
    async with Client() as client:
        print(await client.settings.allowPlace.set(True))
        print(await client.settings.allowPlace.get())
        print(await client.settings.allowPlace.toggle())
        print(await client.settings.allowPlace.reset())


asyncio.run(main())

Return shape

All settings operations return CommandDispatchResult.
The command text uses the `set` command internally:
- set <name> <value>
- set <name>
- set toggle <name>
- set reset <name>

Common mistakes

  • Expecting direct Python booleans back from get(); you get dispatch payload.
  • Forgetting that setting names are Baritone setting identifiers.

Related methods

  • commands/control.md
  • tasks-events-and-waiting.md
  • errors-and-troubleshooting.md