Script API - v1.21.100
    Preparing search index...

    Class AimAssistRegistryBeta

    A container for APIs related to the world's aim-assist settings.

    Index

    Constructors

    Properties

    DefaultPresetId: "minecraft:aim_assist_default" = 'minecraft:aim_assist_default'

    The default aim-assist preset Id that is used when not otherwise specified.

    This property can't be read in early-execution mode.

    Methods

    • Parameters

      Returns AimAssistCategory

      The created category handle.

      Adds an aim-assist category to the registry.

      This function can't be called in read-only mode.

      This function can't be called in early-execution mode.

      import { world, system, AimAssistCategorySettings, AimAssistRegistry, Player } from "@minecraft/server";

      // Basic category creation and addition
      // This Demonstrates how to add categories to AimAssistRegistry via world.getAimAssist()
      function createBasicAimAssistCategory() {
      console.log("=== Creating Basic Aim Assist Category ===");

      // Get the AimAssist registry from the world
      const aimAssistRegistry: AimAssistRegistry = world.getAimAssist();

      // Create a new category with custom settings
      const basicCategorySettings = new AimAssistCategorySettings("jayly:mining_priority");

      // Configure block priorities (higher values = higher priority)
      const blockPriorities: Record<string, number> = {
      "minecraft:diamond_ore": 10,
      "minecraft:gold_ore": 8,
      "minecraft:iron_ore": 6,
      "minecraft:coal_ore": 4,
      "minecraft:stone": 2,
      };

      // Set the block priorities for this category
      basicCategorySettings.setBlockPriorities(blockPriorities);

      // Add the category to the registry
      aimAssistRegistry.addCategory(basicCategorySettings);

      console.log(`Added category '${basicCategorySettings.identifier}' to AimAssist registry`);
      console.log("Block priorities set:", blockPriorities);
      }

      system.run(() => createBasicAimAssistCategory());
    • Returns AimAssistCategory[]

      An array of all available category objects.

      Gets all available categories in the registry.

      This function can't be called in early-execution mode.

    • Parameters

      • categoryId: string

      Returns AimAssistCategory

      The category object if it exists, otherwise returns undefined.

      Gets the category associated with the provided Id.

      This function can't be called in read-only mode.

      This function can't be called in early-execution mode.

      import { world } from "@minecraft/server";

      world.getAimAssist().getCategory("jayly:mining_priority");
    • Parameters

      • presetId: string

        The Id of the preset to retrieve. Must have a namespace.

      Returns AimAssistPreset

      The preset object if it exists, otherwise returns undefined.

      Gets the preset associated with the provided Id.

      This function can't be called in read-only mode.

      This function can't be called in early-execution mode.

    • Returns AimAssistPreset[]

      An array of all available preset objects.

      Gets all available presets in the registry.

      This function can't be called in early-execution mode.