2021-10-08 12:59:03 +02:00
{
2021-10-08 13:04:13 +02:00
"$id" : "blockception.minecraft.behavior.entities.minecraft.interact" ,
2021-10-08 12:59:03 +02:00
"type" : "object" ,
2021-10-08 13:04:13 +02:00
"title" : "Interact" ,
2021-10-08 12:59:03 +02:00
"description" : "Defines interactions with this entity." ,
"additionalProperties" : false ,
2022-02-09 13:33:20 +01:00
"examples" : [ { "interactions" : [ { } ] } ] ,
2021-10-08 12:59:03 +02:00
"definitions" : {
"interaction_spec" : {
"type" : "object" ,
2021-12-20 22:12:01 +01:00
"additionalProperties" : false ,
2021-10-08 12:59:03 +02:00
"properties" : {
"add_items" : {
"type" : "object" ,
"description" : "Loot table with items to add to the player's inventory upon successful interaction." ,
"title" : "Add Items" ,
"additionalProperties" : false ,
"properties" : {
"table" : {
"type" : "string" ,
"$ref" : "../../../../general/loot_table/identifier.json" ,
"description" : "File path, relative to the Behavior Pack's path, to the loot table file." ,
"title" : "Table"
}
}
} ,
"cooldown" : {
2022-06-07 23:20:52 +02:00
"title" : "cooldown" ,
2021-10-08 12:59:03 +02:00
"type" : "number" ,
"default" : 0 ,
2022-06-07 23:20:52 +02:00
"description" : "Time in seconds before this entity can be interacted with again."
2021-10-08 12:59:03 +02:00
} ,
2022-06-07 20:13:16 +02:00
"cooldown_after_being_attacked" : {
2022-06-07 23:20:52 +02:00
"title" : "cooldown after being attacked" ,
2022-06-07 20:13:16 +02:00
"type" : "number" ,
2022-06-07 23:20:52 +02:00
"default" : 0 ,
"description" : "Time in seconds before this entity can be interacted with after being attacked."
2022-06-07 20:13:16 +02:00
} ,
2022-02-09 13:33:20 +01:00
"health_amount" : {
2022-06-07 23:20:52 +02:00
"title" : "health amount" ,
"type" : "integer" ,
2022-02-09 13:33:20 +01:00
"default" : 0 ,
2022-06-07 23:20:52 +02:00
"description" : "The amount of health this entity will recover or hurt when interacting with this item. Negative values will harm the entity."
2022-02-09 13:33:20 +01:00
} ,
2021-10-08 12:59:03 +02:00
"hurt_item" : {
2022-06-07 23:20:52 +02:00
"title" : "hurt item" ,
2021-10-08 12:59:03 +02:00
"type" : "integer" ,
"default" : 0 ,
2022-06-07 23:20:52 +02:00
"description" : "The amount of damage the item will take when used to interact with this entity. A value of 0 means the item won't lose durability."
2021-10-08 12:59:03 +02:00
} ,
"interact_text" : {
2022-06-07 23:20:52 +02:00
"title" : "interact text" ,
2021-10-08 12:59:03 +02:00
"type" : "string" ,
"default" : "" ,
2022-06-07 23:20:52 +02:00
"description" : "Text to show when the player is able to interact in this way with this entity when playing with Touch-screen controls."
2021-10-08 12:59:03 +02:00
} ,
2021-10-11 18:10:42 +02:00
"on_interact" : {
"$ref" : "../types/trigger.json" ,
"description" : "Event to fire when the interaction occurs." ,
"title" : "On Interact"
} ,
2021-10-08 12:59:03 +02:00
"particle_on_start" : {
"type" : "object" ,
"description" : "Particle effect that will be triggered at the start of the interaction." ,
"title" : "Particle On Start" ,
"properties" : {
"particle_offset_towards_interactor" : {
"type" : "boolean" ,
"description" : "Whether or not the particle will appear closer to who performed the interaction." ,
"title" : "Particle Offset Towards Interactor"
} ,
2021-10-11 18:10:42 +02:00
"particle_type" : {
"type" : "string" ,
"description" : "The type of particle that will be spawned." ,
"title" : "Particle Type"
} ,
2021-10-08 12:59:03 +02:00
"particle_y_offset" : {
"type" : "number" ,
"description" : "Will offset the particle this amount in the y direction." ,
"title" : "Particle Y Offset"
}
}
} ,
"play_sounds" : {
"type" : "string" ,
"default" : "" ,
"description" : "List of sounds to play when the interaction occurs." ,
"title" : "Play Sounds"
} ,
"spawn_entities" : {
"type" : "string" ,
"default" : "" ,
"description" : "List of entities to spawn when the interaction occurs." ,
"title" : "Spawn Entities"
} ,
"spawn_items" : {
"type" : "object" ,
"description" : "Loot table with items to drop on the ground upon successful interaction." ,
"title" : "Spawn Items" ,
"additionalProperties" : false ,
"properties" : {
"table" : {
"type" : "string" ,
"$ref" : "../../../../general/loot_table/identifier.json" ,
"description" : "File path, relative to the Behavior Pack's path, to the loot table file." ,
"title" : "Table"
}
}
} ,
"swing" : {
"type" : "boolean" ,
"default" : false ,
"description" : "If true, the player will do the `swing` animation when interacting with this entity." ,
"title" : "Swing"
} ,
"transform_to_item" : {
"type" : "string" ,
"title" : "Transform To Item" ,
"description" : "The feed item used will transform to this item upon successful interaction. Format: itemName:auxValue"
} ,
2021-10-11 18:10:42 +02:00
"use_item" : {
"type" : "boolean" ,
"default" : false ,
"description" : "If true, the interaction will use an item." ,
"title" : "Use Item"
2022-03-10 16:53:03 -06:00
} ,
2022-06-07 20:13:16 +02:00
"vibration" : {
"title" : "Vibration" ,
"type" : "string" ,
"description" : "Vibration to emit when the interaction occurs. Admitted values are entity_interact (used by default), shear, and none (no vibration emitted)."
2022-06-07 23:20:52 +02:00
} ,
"give_item" : {
"type" : "boolean" ,
"title" : "Give Item" ,
"$comment" : "UNDOCUMENTED" ,
"description" : "UNDOCUMENTED Item to give to the player upon successful interaction."
} ,
"take_item" : {
"type" : "boolean" ,
"title" : "Take Item" ,
"$comment" : "UNDOCUMENTED" ,
"description" : "UNDOCUMENTED Takes an item from the player"
2021-10-11 18:10:42 +02:00
}
2021-10-08 12:59:03 +02:00
}
}
} ,
"properties" : {
"interactions" : {
"description" : "The interactions" ,
"title" : "Interactions" ,
"oneOf" : [
2021-10-11 18:10:42 +02:00
{
"type" : "object" ,
"$ref" : "#/definitions/interaction_spec"
} ,
{
"type" : "array" ,
"items" : {
"$ref" : "#/definitions/interaction_spec"
}
}
2021-10-08 12:59:03 +02:00
]
}
}
}