跳转至

Trading

文档版本:1.21.0.24

UNDOCUMENTED.

架构

trading:
{
  format_version "format_version"
  array "tiers" : opt
  {
    object "<any array element>" : opt
    {
      array "trades" : opt
      {
        object "<any array element>" : opt
        {
          array "gives" : opt
          {
            string "<any array element>" : opt
            object "<any array element>" : opt
            {
              string "item" : opt
              integer "quantity" : opt
              object "quantity" : opt
              {
                integer "min" : opt
                integer "max" : opt
              }
              array "functions" : opt
              {
                Functions "<any array element>"
              }
              array "choice" : opt
              {
                string "<any array element>" : opt
                object "<any array element>" : opt
                {
                  string "item" : opt
                  number "price_multiplier" : opt
                  array "functions" : opt
                  array "biomes" : opt
                  {
                    item "<any array element>"
                  }
                  integer "quantity" : opt
                  object "quantity" : opt
                  {
                    integer "min" : opt
                    integer "max" : opt
                  }
                }
              }
            }
          }
          array "wants" : opt
          {
            string "<any array element>" : opt
            object "<any array element>" : opt
            {
              string "item" : opt
              integer "quantity" : opt
              object "quantity" : opt
              {
                integer "min" : opt
                integer "max" : opt
              }
              number "price_multiplier" : opt
              array "functions" : opt
              array "choice" : opt
              {
                 "<any array element>" : opt
              }
            }
          }
          integer "trader_exp" : opt
          integer "max_uses" : opt
          integer "weight" : opt
          boolean "reward_exp" : opt
        }
      }
      integer "total_exp_required" : opt
      array "groups" : opt
      {
        object "<any array element>" : opt
        {
          integer "num_to_select" : opt
          array "trades" : opt
        }
      }
    }
  }
}
format_versionformat_version
format_version:
string
tiersarray
A collection of tiers.
tiers
<any array element>object
<any array element>
tradesarray
trades
<any array element>object
<any array element>
givesarray
gives
<any array element>string
<any array element>object
<any array element>
itemstring
quantityinteger
quantityobject
quantity
mininteger
maxinteger
functionsarray
functions
<any array element>Functions
enchant_random_gear:
{
  string "function" : opt
  number "chance" : opt
}
functionstring
UNDOCUMENTED.
chancenumber
Takes a chance modifier to manipulate the algorithm. Note that a chance modifier of 1.0 doesn't mean a 100% chance that gear will become enchanted.
enchant_book_for_trading:
{
  string "function" : opt
  integer "base_cost" : opt
  integer "base_random_cost" : opt
  integer "per_level_random_cost" : opt
  integer "per_level_cost" : opt
}
functionstring
UNDOCUMENTED.
base_costinteger
UNDOCUMENTED.
base_random_costinteger
UNDOCUMENTED.
per_level_random_costinteger
UNDOCUMENTED.
per_level_costinteger
UNDOCUMENTED.
enchant_randomly:
{
  string "function" : opt
  boolean "treasure" : opt
}
functionstring
UNDOCUMENTED.
treasureboolean
Supports the optional treasure boolean (true/false) to allow treasure enchantments to be toggled on and off.
enchant_with_levels:
{
  string "function" : opt
  integer "levels" : opt
  object "levels" : opt
  {
    integer "min" : opt
    integer "max" : opt
  }
  boolean "treasure" : opt
}
functionstring
UNDOCUMENTED.
levelsinteger
UNDOCUMENTED.
levelsobject
UNDOCUMENTED.
levels
mininteger
maxinteger
treasureboolean
UNDOCUMENTED.
exploration_map:
{
  string "function" : opt
  string "destination" : opt
}
functionstring
Transforms a normal map into a treasure map that marks the location of hidden treasure.
destinationstring
The destination value defines what type of treasure map they receive.
fill_container:
{
  string "function" : opt
  string "loot_table" : opt
}
functionstring
UNDOCUMENTED.
loot_tablestring
UNDOCUMENTED.
furnace_smelt:
{
  string "function" : opt
  array "conditions" : opt
  {
    conditions "<any array element>"
  }
}
functionstring
UNDOCUMENTED.
conditionsarray
UNDOCUMENTED.
conditions
<any array element>conditions
entity_properties:
{
  string "condition" : opt
  string "entity" : opt
  object "properties" : opt
  {
    boolean "on_fire" : opt
    boolean "on_ground" : opt
  }
}
conditionstring
Returns true if the actor properties defined were executed.
entitystring
The entity to test. The value must be only this.
propertiesobject
The entity's properties. on_fire, on_ground is used for now.
properties
on_fireboolean
Checks if the entity is on fire or not.
on_groundboolean
Checks if the entity is on the ground or not.
has_mark_variant:
{
  string "condition" : opt
  integer "value" : opt
}
conditionstring
Returns the condition true if the actor's mark variant is matched to the value.
valueinteger
Tests for the actor's mark variant (if it has one).
killed_by_player:
{
  string "condition" : opt
}
conditionstring
UNDOCUMENTED.
killed_by_player_or_pets:
{
  string "condition" : opt
}
conditionstring
UNDOCUMENTED.
random_chance:
{
  string "condition" : opt
  number "chance" : opt
  number "max_chance" : opt
}
conditionstring
UNDOCUMENTED.
chancenumber
UNDOCUMENTED.
max_chancenumber
The maximum random chance value allowed.
random_chance_with_looting:
{
  string "condition" : opt
  number "chance" : opt
  number "looting_multiplier" : opt
}
conditionstring
UNDOCUMENTED.
chancenumber
The random chance of the value.
looting_multipliernumber
The multiplier for the chance if the target entity has the looting enchant that affects the actor.
random_difficulty_chance:
{
  string "condition" : opt
  number "default_chance" : opt
  number "easy" : opt
  number "hard" : opt
  number "normal" : opt
  number "peaceful" : opt
}
conditionstring
UNDOCUMENTED.
default_chancenumber
The default random chance if the level difficulty is not assigned.
easynumber
The default random chance if the level difficulty is in easy. Omitting this field will set the value to default_chance field.
hardnumber
The default random chance if the level difficulty is in hard. Omitting this field will set the value to default_chance field.
normalnumber
The default random chance if the level difficulty is in normal. Omitting this field will set the value to default_chance field.
peacefulnumber
The default random chance if the level difficulty is in peaceful. Omitting this field will set the value to default_chance field.
random_regional_difficulty_chance:
{
  string "condition" : opt
  number "default_chance" : opt
  number "max_chance" : opt
  number "easy" : opt
  number "hard" : opt
  number "normal" : opt
  number "peaceful" : opt
}
conditionstring
UNDOCUMENTED.
default_chancenumber
The default random chance if the level difficulty is not assigned.
max_chancenumber
UNDOCUMENTED.
easynumber
The default random chance if the level difficulty is in easy. Omitting this field will set the value to default_chance field.
hardnumber
The default random chance if the level difficulty is in hard. Omitting this field will set the value to default_chance field.
normalnumber
The default random chance if the level difficulty is in normal. Omitting this field will set the value to default_chance field.
peacefulnumber
The default random chance if the level difficulty is in peaceful. Omitting this field will set the value to default_chance field.
looting_enchant:
{
  string "function" : opt
  object "count" : opt
  {
    integer "min" : opt
    integer "max" : opt
  }
}
functionstring
UNDOCUMENTED.
countobject
UNDOCUMENTED.
count
mininteger
maxinteger
random_aux_value:
{
  string "function" : opt
  object "values" : opt
  {
    integer "min" : opt
    integer "max" : opt
  }
}
functionstring
UNDOCUMENTED.
valuesobject
UNDOCUMENTED.
values
mininteger
UNDOCUMENTED.
maxinteger
UNDOCUMENTED.
random_block_state:
{
  string "function" : opt
  string "block_state" : opt
  object "values" : opt
  {
    integer "min" : opt
    integer "max" : opt
  }
}
functionstring
UNDOCUMENTED.
block_statestring
UNDOCUMENTED.
valuesobject
UNDOCUMENTED.
values
mininteger
maxinteger
set_actor_id:
{
  string "function" : opt
  string "id" : opt
}
functionstring
UNDOCUMENTED.
idstring
UNDOCUMENTED.
set_banner_details:
{
  string "function" : opt
  integer "type" : opt
}
functionstring
UNDOCUMENTED.
typeinteger
UNDOCUMENTED.
set_book_contents:
{
  string "function" : opt
  string "author" : opt
  string "title" : opt
  array "pages" : opt
  {
    string "<any array element>" : opt
  }
}
functionstring
UNDOCUMENTED.
authorstring
UNDOCUMENTED.
titlestring
UNDOCUMENTED.
pagesarray
UNDOCUMENTED.
pages
<any array element>string
set_count:
{
  boolean "add" : opt
  string "function" : opt
  integer "count" : opt
  object "count" : opt
  {
    integer "min" : opt
    integer "max" : opt
  }
}
addboolean
UNDOCUMENTED.
functionstring
UNDOCUMENTED.
countinteger
UNDOCUMENTED.
countobject
UNDOCUMENTED.
count
mininteger
maxinteger
set_damage:
{
  boolean "add" : opt
  string "function" : opt
  number "damage" : opt
  object "damage" : opt
  {
    number "min" : opt
    number "max" : opt
  }
}
addboolean
UNDOCUMENTED.
functionstring
UNDOCUMENTED.
damagenumber
UNDOCUMENTED.
damageobject
UNDOCUMENTED.
damage
minnumber
UNDOCUMENTED.
maxnumber
UNDOCUMENTED.
set_data:
{
  string "function" : opt
  integer "data" : opt
  object "data" : opt
  {
    integer "min" : opt
    integer "max" : opt
  }
}
functionstring
UNDOCUMENTED.
datainteger
UNDOCUMENTED.
dataobject
UNDOCUMENTED.
data
mininteger
UNDOCUMENTED.
maxinteger
UNDOCUMENTED.
set_data_from_color_index:
{
  string "function" : opt
}
functionstring
UNDOCUMENTED.
trader_material_type:
{
  string "function" : opt
}
functionstring
UNDOCUMENTED.
random_dye:
{
  string "function" : opt
}
functionstring
UNDOCUMENTED.
set_lore:
{
  string "function" : opt
  array "lore" : opt
  {
    string "<any array element>" : opt
  }
}
functionstring
UNDOCUMENTED.
lorearray
UNDOCUMENTED.
lore
<any array element>string
set_name:
{
  string "function" : opt
  string "name" : opt
}
functionstring
UNDOCUMENTED.
namestring
UNDOCUMENTED.
specific_enchants:
{
  string "function" : opt
  string "enchants" : opt
  object "enchants" : opt
  {
    string "id" : opt
    integer "level" : opt
    array "level" : opt
    {
      integer "0..0" : opt
      integer "1..1" : opt
    }
  }
  array "enchants" : opt
  {
    object "<any array element>" : opt
    {
    }
  }
}
functionstring
Specific enchants.
enchantsstring
A enchanting specification.
enchantsobject
A enchanting specification.
enchants
idstring
levelinteger
levelarray
level
0..0integer
1..1integer
enchantsarray
A enchanting specification.
enchants
<any array element>object
<any array element>
choicearray
UNDOCUMENTED.
choice
<any array element>string
<any array element>object
<any array element>
itemstring
price_multipliernumber
functionsarray
functions
biomesarray
UNDOCUMENTED.
biomes
<any array element>item
item:
string
quantityinteger
quantityobject
quantity
mininteger
maxinteger
wantsarray
wants
<any array element>string
<any array element>object
<any array element>
itemstring
quantityinteger
quantityobject
quantity
mininteger
maxinteger
price_multipliernumber
UNDOCUMENTED.
functionsarray
functions
choicearray
UNDOCUMENTED.
choice
<any array element>
trader_expinteger
max_usesinteger
weightinteger
reward_expboolean
total_exp_requiredinteger
groupsarray
A collection of groups.
groups
<any array element>object
<any array element>
num_to_selectinteger
tradesarray
trades