Module minecraft_json::minecraft::data::advancement[][src]

Expand description

Custom advancements in data packs of a Minecraft world store the advancement data for that world as separate JSON files.

assert_equiv_pretty!(r#"{
  "display": {
    "icon": {
      "item": "minecraft:red_bed"
    },
    "title": {
      "translate": "advancements.adventure.sleep_in_bed.title"
    },
    "description": {
      "translate": "advancements.adventure.sleep_in_bed.description"
    }
  },
  "parent": "minecraft:adventure/root",
  "criteria": {
    "slept_in_bed": {
      "trigger": "minecraft:slept_in_bed",
      "conditions": {}
    }
  },
  "requirements": [
    [
      "slept_in_bed"
    ]
  ]
}"#, Advancement {
    parent: Some("minecraft:adventure/root".to_string()),
    display: Some(Box::new(Display {
        icon: Some(Icon {
            item: "minecraft:red_bed".to_string(),
            nbt: None,
        }),
        title: TextComponent::Translated {
            translate: "advancements.adventure.sleep_in_bed.title".to_string(),
            with: Vec::new(),
            properties: TextComponentTags::default(),
        },
        description: TextComponent::Translated {
            translate: "advancements.adventure.sleep_in_bed.description".to_string(),
            with: Vec::new(),
            properties: TextComponentTags::default(),
        },
        frame: Frame::default(),
        background: None,
        show_toast: true,
        announce_to_chat: true,
        hidden: false,
    })),
    criteria: btreemap!{
        "slept_in_bed".to_string() => Criterion::SleptInBed {
            location: None,
            player: None,
        },
    },
    requirements: vec![vec!["slept_in_bed".to_string()]],
    rewards: None,
});

Structs

Advancement

An advancement JSON file.

Display

Display data for an Advancement.

Icon

An item (with NBT data) as icon.

Rewards

An object representing the rewards provided when an Advancement is obtained.

Enums

Criterion

Strongly-typed trigger and conditions for a criterion.

Frame

Type of frame for the icon.