Scenamatica Reference

website·Indexed 31 days ago

https://scenamatica.kunlab.org

Reference documentation for Scenamatica actions, covering world management (weather, game rules, saving/unloading), server administration (plugin toggles, whitelists, tab completion), player interactions (joining, advancements), and entity and inventory operations.

Tokens
86.5K
Snippets
419
Records
891
Agent score
49%

What's inside Scenamatica

  1. Overview of Scenamatica Scenario Triggers

    Triggers are the starting conditions that initiate a scenario test. Every scenario must have at least one trigger. A single scenario can have multiple triggers; the scenario will execute if any one of those triggers is fired. If multiple scenarios share the same trigger, they are added to an execution queue and processed sequentially rather than simultaneously.
  2. Overview of Scenamatica Scenario Testing

    Scenamatica allows plugin developers to define step-by-step tests in a 'scenario file'. The system reads these files to trigger plugin functions and verify the results. A scenario test consists of setting up a prerequisite environment, executing actions to trigger specific plugin behavior, and verifying that the expected behavior occurs.
  3. Overview of Player Actions

    The system provides a variety of actions to manipulate player state, behavior, and attributes. These include movement (teleport, move), interaction (block/entity interaction, item consumption), and server-level events (join, quit, kick).
  4. Overview of Scenamatica

    Scenamatica is an end-to-end test automation framework specifically designed for PaperMC plugins. It allows developers to automatically verify the correctness and failure cases of plugin functions using multi-scenario tests defined in YAML. This enables rapid regression testing and can be integrated into existing CI/CD pipelines (such as GitHub Actions) to continuously monitor plugin quality.
  5. Overview of Scenamatica for PaperMC Plugins

    Scenamatica is an end-to-end test automation framework designed specifically for PaperMC plugins. It allows developers to automatically verify the correctness and abnormal behavior of plugin functions using multi-scenario tests defined in YAML. It supports regression testing, CI/CD integration (e.g., GitHub Actions), and automated environment setup for players (actors) and worlds (stages).
  6. Overview of Scenario Testing with Scenamatica

    Scenamatica enables scenario testing for PaperMC plugins by reproducing player operations according to predefined scenarios to verify plugin correctness. This complements unit testing (e.g., JUnit, Mockito) and E2E testing (e.g., Selenium) by providing a way to validate plugin behavior within the Minecraft server environment.
  7. Overview of Scenamatica Target Selectors

    Scenamatica Target Selectors are a syntax for specifying entities and players. They extend the standard Minecraft target selector system and are interpreted by Scenamatica's own engine. This custom implementation is used instead of the Bukkit API to ensure that deleted entities or entities in unloaded worlds can still be referenced, providing more flexibility for actions and contexts.
  8. Overview of Scenamatica scenario components

    A Scenamatica scenario file consists of several key elements used to define and test plugin behavior:

    • Metadata: Information used by Scenamatica to identify the scenario file.
    • Trigger: Conditions that cause the scenario test to fire.
    • Order: Controls the execution sequence when multiple scenarios are triggered simultaneously (e.g., during plugin startup).
    • Context: Prerequisites for the test, such as the world, players, or mob entities.
    • Main Scenario: The flow of actions used to trigger and verify plugin functionality.
    • Conditional Execution: Requirements for execution, such as milestones.
    • Constant Definitions: Reusable values or structures.
  9. Overview of Inventory Item Types

    The inventory item system manages data related to items, player inventories, and attribute modifications. Key structures include:

    • ItemStack: Stores information about individual items.
    • PlayerInventory: Stores information regarding the player's inventory.
    • Inventory: General inventory structure information.
    • AttributeModifier: Stores information about attribute changes.
  10. Use the ItemStack type to manage item data

    The ItemStack type is used to store and manage comprehensive information about an item within the inventory system. It tracks the item's identity, quantity, durability, and various metadata such as custom names, lore, and enchantments.
    // Example of the ItemStack structure based on its properties
    interface ItemStack {
      amount: number;           // Item quantity
      attributes: AttributeModifierDoc[]; // Attribute modifiers applied to the item
      customModel: number;      // Custom model data
      damage: number;           // Item damage value
      destroyables: NamespacedKey[]; // Blocks that this item can destroy
      enchants: object;          // Enchantments applied to the item
      flags: ItemFlag[];         // Item flags
      localizedName: string;    // Localized name of the item
      lores: string[];          // Item lore/description lines
      name: string;             // Display name of the item
      placeables: NamespacedKey[]; // Blocks that this item can place
      type: Material;           // The type of the item (Material enum)
      unbreakable: boolean;     // Whether the item has infinite durability
    }