Minecraft Wiki
Advertisement
Diese Seite ist unvollständig.
Du kannst helfen, indem Du sie ergänzt. Fehlende Inhalte: Datenquelle ergänzen und Datenstruktur übersetzen

Prädikate beinhalten Eigenschaften für Bedingungen die man im Selektor der Zielauswahl @e[predicate=...] oder mit dem Befehl /execute if|unless predicate ... verwenden kann. Sie werden in Datenpaketen angelegt und es gibt keine Standard-Prädikatdateien, man kann sich also keine Vorlage holen um eigene zu erstellen, stattdessen benötigt man die Datenstruktur.

Datenquelle

  • Name des Datenpakets
    • pack.mcmeta: Die Definitionsdatei.
    • data: Eigene Weltdaten.
      • eigener-namensraum: Für eigene Weltdaten legt man einen eigenen Namensraum an.
        • predicates: Eigene Prädikate.

Datenstruktur

  • Der Wurzel-Tag.
    • condition: Die Voraussetzungen.
    • Andere Teile der Bedingung, siehe unten.

Die möglichen Werte für condition und den zugehörigen zusätzlichen Inhalt:

  • alternative - Verbindet die Bedingungen der Parameter terms als ein "ODER".
    • terms: Eine Liste der Bedingungen für die Teilnahme mit "ODER".
      • Eine Bedingung.
  • block_state_property - Überprüft den Blockzustand.
    • block: A block ID. Test will fail if the block doesn't match.
    • properties: (Optional) A map of block property names to values. All values are strings. Test will fail if the block doesn't match.
  • damage_source_properties - Überprüft die Eigenschaften der Schadensquelle.
    • is_explosion
    • is_projectile
    • is_fire
    • is_lightning
    • is_magic
    • bypasses_magic: Dies gilt nur für Hunger
    • bypasses_invulnerability: Dies gilt nur für Schäden, wenn ein Spieler in die Leere fällt
    • bypasses_armor
    • source_entity: Die Ursache des Schadens. Wenn beispielsweise ein Skelett einen Spieler mit einem Pfeil schießt, ist das Skelett die Quellentität.
    • direct_entity: Die direkte Ursache des Schadens. Wenn beispielsweise ein Skelett einen Spieler mit einem Pfeil schießt, ist der Pfeil die direkte Entität.
  • entity_properties - Testeigenschaften einer Entität.
    • entity: Specifies the entity to check for the condition. Set to this to use the entity that died or the player that gained the advancement, opened the container or broke the block, killer for the killer, or killer_player for a killer that is a player.
    • predicate: Das auf den Standort angewendete Prädikat verwendet dieselbe Struktur wie Fortschritte.
      • flags: Prädikatflags, die überprüft werden sollen.
        • is_on_fire: Überprüft, ob das Objekt brennt.
        • is_sneaking: Überprüft, ob das Objekt schleicht.
        • is_sprinting: Überprüft, ob das Objekt sprintet.
        • is_swimming: Überprüft, ob das Objekt schwimmt.
        • is_baby: Überprüft, ob das Objekt ein Baby ist.
  • entity_scores - Test the scoreboard scores of an entity.
    • entity: Specifies the entity to check for the condition. Set to this to use the entity that died or the player that gained the advancement, opened the container or broke the block, killer for the killer, or killer_player for a killer that is a player.
    • scores: Scores to check. All specified scores must pass for the condition to pass.
      • A score: Key name is the objective while the value is the exact score value required for the condition to pass.
      • A score: Key name is the objective while the value specifies a range of score values required for the condition to pass.
        • min: Mindestpunktzahl.
        • max: Höchstpunktzahl.
  • inverted - Inverts condition from parameter term.
    • term: Die zu negierende Bedingung.
  • killed_by_player - Test if a killer_player entity is available.
    • inverse: If true, the condition passes if killer_player is not available.
  • location_check - Überprüft, ob der aktuelle Standort übereinstimmt.
    • offsetX - optional offsets to location
    • offsetY - optional offsets to location
    • offsetZ - optional offsets to location
    • predicate: Predicate applied to location, uses same structure as advancements.
  • match_tool - Überprüft ein Werkzeug.
    • predicate: Prädikat auf Element angewendet, verwendet dieselbe Struktur wie Fortschritte.
  • random_chance - Prüft, ob eine Zufallszahl zwischen 0.0 und 1.0 kleiner als ein angegebener Wert ist.
    • chance: Erfolgsquote als Zahl 0.0–1.0.
  • random_chance_with_looting - Test if a random number 0.0–1.0 is less than a specified value, affected by the level of Looting on the killer entity.
    • chance: Basiserfolgsrate.
    • looting_multiplier: Looting adjustment to the base success rate. Formula is chance + (looting_level * looting_multiplier).
  • reference - Test if another referred condition (predicate) passes.
    • name: The Namensraum ID of the condition (predicate) referred to. Cyclic reference will cause a parsing failure.
  • survives_explosion - Gibt true mit einer Wahrscheinlichkeit von 1 / Explosionsradius zurück.
  • table_bonus - Passes with probability picked from table, indexed by enchantment level.
    • enchantment: ID der Verzauberung.
    • chances: Liste der Wahrscheinlichkeiten für die Verzauberungsstufe, indiziert von 0.
  • time_check - Prüft die aktuelle Uhrzeit.
    • value: Die Zeit in Ticks.
    • value
      • max: Maximalwert.
      • min: Minimalwert.
    • period: If present, time will be modulo-divided by this value (for example, if set to 24000, value will operate on a time period of days).
  • tool_enchantment - Testet die Verzauberungen des Werkzeugs.
    • enchantments: Liste der Verzauberungen, die das Werkzeug haben muss.
      • : Eine Verzauberung.
        • enchantment: Die Verzauberungs-ID.
        • levels: Die Stufe, die diese Verzauberung haben muss.
          • min: Minimal-Level.
          • max: Maximal-Level.
  • weather_check - Prüft auf einen aktuellen Wetterzustand.
    • raining: Wenn true, wird die Bedingung nur dann als true ausgewertet, wenn es regnet.
    • thundering: Wenn true, wird die Bedingung nur dann als true ausgewertet, wenn es gewitter.

Beispiele

Beispiel

Die Datei .minecraft/saves/meinewelt/datapacks/meinpaket/data/meinedaten/predicates/unterordner/eisenhand.json könnte so aussehen:
{
  "condition": "minecraft:entity_properties",
  "entity": "this",
  "predicate": {
    "equipment": {
      "mainhand": {
        "item": "minecraft:iron_sword"
      }
    }
  }
}

Geschichte

Versionsgeschichte der Java Edition
Vollversion 1.15 (19w38a)
Advertisement