//////////////////////////////
//
//        WorldEdit
//    Made By M7mdTG ;)
//
//////////////////////////////

{
	"format_version": "1.10.0",
	"animation_controllers": {
		"controller.animation.we_eraser": {
			"states": {
				"erasing": {
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ function we/tools/erase"
					],
					"transitions": [
						{
							"not_erasing": "(1.0)"
						}
					]
				},
				"not_erasing": {
					"transitions": [
						{
							"erasing": "query.get_equipped_item_name(0, 0) == 'we_eraser' && query.is_using_item"
						}
					]
				}
			}
		},
		"controller.animation.we_brush": {
			"states": {
				"drawing": {
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ function we/tools/draw"
					],
					"transitions": [
						{
							"not_drawing": "(1.0)"
						}
					]
				},
				"not_drawing": {
					"transitions": [
						{
							"drawing": "query.get_equipped_item_name(0, 0) == 'we_brush' && query.is_using_item"
						}
					]
				}
			}
		},
		"controller.animation.we_cursor": {
			"states": {
				"cursor": {
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ tag @s add we_brush_cursor",
						"/execute @s[tag=we_host] ^^^10 summon worldedit:cursor ~~56.75~"
					],
					"transitions": [
						{
							"no_cursor": "query.get_equipped_item_name(0, 0) != 'we_brush' && query.get_equipped_item_name(0, 0) != 'we_eraser'"
						}
					]
				},
				"no_cursor": {
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ tag @s remove we_brush_cursor",
						"/execute @s[tag=we_host] ~~~ tp @e[type=worldedit:cursor] ~ -100 ~"
					],
					"transitions": [
						{
							"cursor": "query.get_equipped_item_name(0, 0) == 'we_brush' || query.get_equipped_item_name(0, 0)  == 'we_eraser'"
						}
					]
				}
			}
		},
		"controller.animation.we_selection": {
			"states": {
				"controlling": {
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ tag @s add we_settings"
					],
					"on_exit": [
						"/execute @s[tag=we_host] ~~~ tag @s remove we_settings",
						"/execute @s[tag=we_host] ~~~ function we/misc/title_reset"
					],
					"transitions": [
						{
							"not_controlling": "query.get_equipped_item_name(0, 0) != 'we_settings'"
						}
					]
				},
				"not_controlling": {
					"transitions": [
						{
							"controlling": "query.get_equipped_item_name(0, 0) == 'we_settings'"
						}
					]
				}
			}
		},
		"controller.animation.we_selector": {
			"states": {
				"default": {
					"transitions": [
						{
							"selection": "query.get_equipped_item_name(0, 0) == 'we_settings' && variable.attack_time > 0 && !query.is_sneaking"
						},
						{
							"bselection": "query.get_equipped_item_name(0, 0) == 'we_settings' && variable.attack_time > 0 && query.is_sneaking"
						},
						{
							"value": "query.get_equipped_item_name(0, 0) == 'we_settings' && query.is_using_item && !query.is_sneaking"
						},
						{
							"extreme_value": "query.get_equipped_item_name(0, 0) == 'we_settings' && query.is_using_item && query.is_sneaking"
						}
					]
				},
				"selection": {
					"transitions": [
						{
							"default": "(query.get_equipped_item_name(0, 0) == 'we_settings' && !variable.attack_time) || query.get_equipped_item_name(0, 0) != 'we_settings'"
						}
					],
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ function we/misc/settings/selection"
					]
				},
				"bselection": {
					"transitions": [
						{
							"default": "(query.get_equipped_item_name(0, 0) == 'we_settings' && !variable.attack_time) || query.get_equipped_item_name(0, 0) != 'we_settings'"
						}
					],
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ function we/misc/settings/bselection"
					]
				},
				"value": {
					"transitions": [
						{
							"default": "(query.get_equipped_item_name(0, 0) == 'we_settings' && !query.is_using_item) || query.get_equipped_item_name(0, 0) != 'we_settings'"
						}
					],
					"on_exit": [
						"/execute @s[tag=we_host] ~~~ function we/misc/settings/value"
					]
				},
				"extreme_value": {
					"transitions": [
						{
							"default": "(query.get_equipped_item_name(0, 0) == 'we_settings' && !query.is_using_item) || query.get_equipped_item_name(0, 0) != 'we_settings'"
						}
					],
					"on_exit": [
						"/execute @a[tag=we_host] ~~~ function we/misc/settings/extreme_value"
					]
				}
			}
		},
		"controller.animation.we_build_menu": {
			"states": {
				"holding": {
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ tag @s add we_build_menu"
					],
					"on_exit": [
						"/execute @s[tag=we_host] ~~~ tag @s remove we_build_menu",
						"/execute @s[tag=we_host] ~~~ function we/misc/title_reset"
					],
					"transitions": [
						{
							"not_holding": "query.get_equipped_item_name(0, 0) != 'we_build_menu'"
						}
					]
				},
				"not_holding": {
					"transitions": [
						{
							"holding": "query.get_equipped_item_name(0, 0) == 'we_build_menu'"
						}
					]
				}
			}
		},
		"controller.animation.we_builder": {
			"states": {
				"default": {
					"transitions": [
						{
							"selection": "query.get_equipped_item_name(0, 0) == 'we_build_menu' && variable.attack_time > 0 && !query.is_sneaking"
						},
						{
							"bselection": "query.get_equipped_item_name(0, 0) == 'we_build_menu' && variable.attack_time > 0 && query.is_sneaking"
						},
						{
							"value": "query.get_equipped_item_name(0, 0) == 'we_build_menu' && query.is_using_item"
						}
					]
				},
				"selection": {
					"transitions": [
						{
							"default": "(query.get_equipped_item_name(0, 0) == 'we_build_menu' && !variable.attack_time) || query.get_equipped_item_name(0, 0) != 'we_build_menu'"
						}
					],
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ function we/misc/build_menu/selection"
					]
				},
				"bselection": {
					"transitions": [
						{
							"default": "(query.get_equipped_item_name(0, 0) == 'we_build_menu' && !variable.attack_time) || query.get_equipped_item_name(0, 0) != 'we_build_menu'"
						}
					],
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ function we/misc/build_menu/bselection"
					]
				},
				"value": {
					"transitions": [
						{
							"default": "(query.get_equipped_item_name(0, 0) == 'we_build_menu' && !query.is_using_item) || query.get_equipped_item_name(0, 0) != 'we_build_menu'"
						}
					],
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ function we/misc/build_menu/value"
					]
				}
			}
		},
		"controller.animation.we_book": {
			"states": {
				"holding": {
					"transitions": [
						{
							"not_holding": "query.get_equipped_item_name(0, 0) != 'we_book'"
						},
						{
							"next": "query.get_equipped_item_name(0, 0) == 'we_book' && variable.attack_time > 0 && variable.attack_time < 1 && !query.is_sneaking"
						},
						{
							"prev": "query.get_equipped_item_name(0, 0) == 'we_book' && variable.attack_time > 0 && variable.attack_time < 1 && query.is_sneaking"
						},
						{
							"collect": "query.get_equipped_item_name(0, 0) == 'we_book' && query.is_using_item"
						}
					],
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ tag @s add we_book"
					]
				},
				"not_holding": {
					"transitions": [
						{
							"holding": "query.get_equipped_item_name(0, 0) == 'we_book'"
						}
					],
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ tag @s remove we_book",
						"/execute @s[tag=we_host] ~~~ function we/misc/title_reset"
					]
				},
				"next": {
					"transitions": [
						{
							"holding": "query.get_equipped_item_name(0, 0) == 'we_book'  && (variable.attack_time == 0 || variable.attack_time > 1)"
						},
						{
							"not_holding": "query.get_equipped_item_name(0, 0) != 'we_book'"
						}
					],
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ function we/misc/book/next"
					]
				},
				"prev": {
					"transitions": [
						{
							"holding": "query.get_equipped_item_name(0, 0) == 'we_book'  && (variable.attack_time == 0 || variable.attack_time > 1)"
						},
						{
							"not_holding": "query.get_equipped_item_name(0, 0) != 'we_book'"
						}
					],
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ function we/misc/book/prev"
					]
				},
				"collect": {
					"transitions": [
						{
							"holding": "query.get_equipped_item_name(0, 0) == 'we_book' && !query.is_using_item"
						},
						{
							"not_holding": "query.get_equipped_item_name(0, 0) != 'we_book'"
						}
					],
					"on_entry": [
						"/execute @s[tag=we_host] ~~~ function we/misc/book/collect"
					]
				}
			}
		},
		"controller.animation.we_control": {
			"states": {
				"default": {
					"transitions": [
						{
							"enable": "query.get_equipped_item_name(0, 0) == 'we_enable' && query.is_using_item"
						},
						{
							"disable": "query.get_equipped_item_name(0, 0) == 'we_disable' && query.is_using_item"
						}
					]
				},
				"enable": {
					"transitions": [
						{
							"default": "(query.get_equipped_item_name(0, 0) == 'we_disable' && !query.is_using_item) || query.get_equipped_item_name(0, 0) != 'we_disable'"
						}
					],
					"on_entry": [
						"/tag @s[tag=we_host] add world_edit_enabled",
						"/execute @s[tag=we_host] ~~~ function we/misc/control/enable"
					]
				},
				"disable": {
					"transitions": [
						{
							"default": "(query.get_equipped_item_name(0, 0) == 'we_disable' && !query.is_using_item) || query.get_equipped_item_name(0, 0) != 'we_disable'"
						}
					],
					"on_entry": [
						"/tag @s[tag=we_host] remove world_edit_enabled",
						"/execute @s[tag=we_host] ~~~ function we/misc/control/disable"
					]
				}
			}
		}
	}
}