Trading¶
文档版本:1.21.50.25
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
{
biome "<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_version
:format_version
tiers
:array- A collection of tiers.
tiers
<any array element>
:object
<any array element>
trades
:array
trades
<any array element>
:object
<any array element>
gives
:array
gives
<any array element>
:string
<any array element>
:object
<any array element>
item
:string
quantity
:integer
quantity
:object
quantity
min
:integer
max
:integer
functions
:array
functions
<any array element>
:Functions
function
:string- UNDOCUMENTED.
chance
:number- 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
}
function
:string- UNDOCUMENTED.
base_cost
:integer- UNDOCUMENTED.
base_random_cost
:integer- UNDOCUMENTED.
per_level_random_cost
:integer- UNDOCUMENTED.
per_level_cost
:integer- UNDOCUMENTED.
function
:string- UNDOCUMENTED.
treasure
:boolean- 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
}
function
:string- UNDOCUMENTED.
levels
:integer- UNDOCUMENTED.
levels
:object- UNDOCUMENTED.
levels
min
:integer
max
:integer
treasure
:boolean- UNDOCUMENTED.
function
:string- Transforms a normal map into a treasure map that marks the location of hidden treasure.
destination
:string- The destination value defines what type of treasure map they receive.
function
:string- UNDOCUMENTED.
loot_table
:string- UNDOCUMENTED.
furnace_smelt:
{
string "function" : opt
array "conditions" : opt
{
conditions "<any array element>"
}
}
function
:string- UNDOCUMENTED.
conditions
:array- 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
}
}
condition
:string- Returns true if the actor properties defined were executed.
entity
:string- The entity to test. The value must be only
this
.
properties
:object- The entity's properties.
on_fire
,on_ground
is used for now.
properties
on_fire
:boolean- Checks if the entity is on fire or not.
on_ground
:boolean- Checks if the entity is on the ground or not.
condition
:string- Returns the condition true if the actor's mark variant is matched to the value.
value
:integer- Tests for the actor's mark variant (if it has one).
condition
:string- UNDOCUMENTED.
condition
:string- UNDOCUMENTED.
condition
:string- UNDOCUMENTED.
entity_type
:string- The entity type to match
condition
:string- UNDOCUMENTED.
chance
:number- UNDOCUMENTED.
max_chance
:number- The maximum random chance value allowed.
random_chance_with_looting:
{
string "condition" : opt
number "chance" : opt
number "looting_multiplier" : opt
}
condition
:string- UNDOCUMENTED.
chance
:number- The random chance of the value.
looting_multiplier
:number- 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
}
condition
:string- UNDOCUMENTED.
default_chance
:number- The default random chance if the level difficulty is not assigned.
easy
:number- The default random chance if the level difficulty is in easy. Omitting this field will set the value to
default_chance
field.
hard
:number- The default random chance if the level difficulty is in hard. Omitting this field will set the value to
default_chance
field.
normal
:number- The default random chance if the level difficulty is in normal. Omitting this field will set the value to
default_chance
field.
peaceful
:number- 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
}
condition
:string- UNDOCUMENTED.
default_chance
:number- The default random chance if the level difficulty is not assigned.
max_chance
:number- UNDOCUMENTED.
easy
:number- The default random chance if the level difficulty is in easy. Omitting this field will set the value to
default_chance
field.
hard
:number- The default random chance if the level difficulty is in hard. Omitting this field will set the value to
default_chance
field.
normal
:number- The default random chance if the level difficulty is in normal. Omitting this field will set the value to
default_chance
field.
peaceful
:number- 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
}
}
function
:string- UNDOCUMENTED.
count
:object- UNDOCUMENTED.
count
min
:integer
max
:integer
random_aux_value:
{
string "function" : opt
object "values" : opt
{
integer "min" : opt
integer "max" : opt
}
}
function
:string- UNDOCUMENTED.
values
:object- UNDOCUMENTED.
values
min
:integer- UNDOCUMENTED.
max
:integer- UNDOCUMENTED.
random_block_state:
{
string "function" : opt
string "block_state" : opt
object "values" : opt
{
integer "min" : opt
integer "max" : opt
}
}
function
:string- UNDOCUMENTED.
block_state
:string- UNDOCUMENTED.
values
:object- UNDOCUMENTED.
values
min
:integer
max
:integer
function
:string- UNDOCUMENTED.
id
:string- UNDOCUMENTED.
function
:string- UNDOCUMENTED.
type
:integer- UNDOCUMENTED.
set_book_contents:
{
string "function" : opt
string "author" : opt
string "title" : opt
array "pages" : opt
{
string "<any array element>" : opt
}
}
function
:string- UNDOCUMENTED.
author
:string- UNDOCUMENTED.
title
:string- UNDOCUMENTED.
pages
:array- 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
}
}
add
:boolean- UNDOCUMENTED.
function
:string- UNDOCUMENTED.
count
:integer- UNDOCUMENTED.
count
:object- UNDOCUMENTED.
count
min
:integer
max
:integer
set_damage:
{
boolean "add" : opt
string "function" : opt
number "damage" : opt
object "damage" : opt
{
number "min" : opt
number "max" : opt
}
}
add
:boolean- UNDOCUMENTED.
function
:string- UNDOCUMENTED.
damage
:number- UNDOCUMENTED.
damage
:object- UNDOCUMENTED.
damage
min
:number- UNDOCUMENTED.
max
:number- UNDOCUMENTED.
set_data:
{
string "function" : opt
integer "data" : opt
object "data" : opt
{
integer "min" : opt
integer "max" : opt
}
}
function
:string- UNDOCUMENTED.
data
:integer- UNDOCUMENTED.
data
:object- UNDOCUMENTED.
data
min
:integer- UNDOCUMENTED.
max
:integer- UNDOCUMENTED.
function
:string- UNDOCUMENTED.
function
:string- UNDOCUMENTED.
function
:string- UNDOCUMENTED.
function
:string- UNDOCUMENTED.
lore
:array- UNDOCUMENTED.
lore
<any array element>
:string
function
:string- UNDOCUMENTED.
name
:string- UNDOCUMENTED.
function
:string- This function sets the potion type of compatible items with a potion id..
id
:string- ID of the potion to set.
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
{
}
}
}
function
:string- Specific enchants.
enchants
:string- A enchanting specification.
enchants
:object- A enchanting specification.
enchants
id
:string
level
:integer
level
:array
level
0..0
:integer
1..1
:integer
enchants
:array- A enchanting specification.
enchants
<any array element>
:object
<any array element>
choice
:array- UNDOCUMENTED.
choice
wants
:array
wants
<any array element>
:string
<any array element>
:object
<any array element>
item
:string
quantity
:integer
quantity
:object
quantity
min
:integer
max
:integer
price_multiplier
:number- UNDOCUMENTED.
functions
:array
functions
choice
:array- UNDOCUMENTED.
choice
<any array element>
trader_exp
:integer
max_uses
:integer
weight
:integer
reward_exp
:boolean
total_exp_required
:integer
groups
:array- A collection of groups.
groups
<any array element>
:object
<any array element>
num_to_select
:integer
trades
:array
trades