{
	"format_version": "1.10.0",
	"minecraft:attachable": {
		"description": {
			"identifier": "yes:empty_rpg7",
			"materials": {
				"default": "entity_alphablend",
				"enchanted": "entity_alphablend"
			},
			"textures": {
				"default": "textures/entity/rpg7_texture",
				"enchanted": "textures/misc/enchanted_item_glint"
			},
			"geometry": {
				"has_magazine": "geometry.weeweejuice.rpg7"
				//don't put anything in geometry that are not needed for the render controller
			},
			"scripts": {
				"initialize": [
					"variable.wwj_bob = 0.0;"
				],
				"pre_animation": [
					"variable.tcos0 = (math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed / variable.gliding_speed_value) * 57.3;",
					"variable.expOriginal = query.player_level;",
					"variable.exp = query.player_level;",
					"v.max_pow = 8;",
					"v.is_animating          = (v.exp - (Math.pow(2,14)         -1) > 0) ? 1 : 0;",
					"v.is_animating_test     = (v.exp - (Math.pow(2,14)         -1) > 0) ? (v.exp = v.exp - Math.pow(2,14         )) : 0;",
					//skip 2^13
					"v.bob_toggle_int        = (v.exp - (Math.pow(2,v.max_pow-0)-1) > 0) ? 1*v.is_animating : 0;",
					"v.bob_toggle_int_test   = (v.exp - (Math.pow(2,v.max_pow-0)-1) > 0) ? (v.exp = v.exp - Math.pow(2,v.max_pow-0)) : 0;",
					"v.shotgun_cont_int      = (v.exp - (Math.pow(2,v.max_pow-1)-1) > 0) ? 1*v.is_animating : 0;",
					"v.shotgun_cont_int_test = (v.exp - (Math.pow(2,v.max_pow-1)-1) > 0) ? (v.exp = v.exp - Math.pow(2,v.max_pow-1)) : 0;",
					"v.magazine_int          = (v.exp - (Math.pow(2,v.max_pow-2)-1) > 0) ? 1*v.is_animating : 0;",
					"v.magazine_int_test     = (v.exp - (Math.pow(2,v.max_pow-2)-1) > 0) ? (v.exp = v.exp - Math.pow(2,v.max_pow-2)) : 0;",
					"v.reloading_int         = (v.exp - (Math.pow(2,v.max_pow-3)-1) > 0) ? 1*v.is_animating : 0;",
					"v.reloading_int_test    = (v.exp - (Math.pow(2,v.max_pow-3)-1) > 0) ? (v.exp = v.exp - Math.pow(2,v.max_pow-3)) : 0;",
					"v.slide_int             = (v.exp - (Math.pow(2,v.max_pow-4)-1) > 0) ? 1*v.is_animating : 0;",
					"v.slide_int_test        = (v.exp - (Math.pow(2,v.max_pow-4)-1) > 0) ? (v.exp = v.exp - Math.pow(2,v.max_pow-4)) : 0;",
					"v.recoil3_int           = (v.exp - (Math.pow(2,v.max_pow-5)-1) > 0) ? 1*v.is_animating : 0;",
					"v.recoil3_int_test      = (v.exp - (Math.pow(2,v.max_pow-5)-1) > 0) ? (v.exp = v.exp - Math.pow(2,v.max_pow-5)) : 0;",
					"v.recoil2_int           = (v.exp - (Math.pow(2,v.max_pow-6)-1) > 0) ? 1*v.is_animating : 0;",
					"v.recoil2_int_test      = (v.exp - (Math.pow(2,v.max_pow-6)-1) > 0) ? (v.exp = v.exp - Math.pow(2,v.max_pow-6)) : 0;",
					"v.recoil1_int           = (v.exp - (Math.pow(2,v.max_pow-7)-1) > 0) ? 1*v.is_animating : 0;",
					"v.recoil1_int_test      = (v.exp - (Math.pow(2,v.max_pow-7)-1) > 0) ? (v.exp = v.exp - Math.pow(2,v.max_pow-7)) : 0;",
					"v.shooting_int          = (v.exp - (Math.pow(2,v.max_pow-8)-1) > 0) ? 1*v.is_animating : 0;",
					"v.shooting_int_test     = (v.exp - (Math.pow(2,v.max_pow-8)-1) > 0) ? (v.exp = v.exp - Math.pow(2,v.max_pow-8)) : 0;",
					"variable.recoil = v.recoil1_int*Math.pow(2,0) + v.recoil2_int*Math.pow(2,1) + v.recoil3_int*Math.pow(2,2);",
					"variable.bob_toggle_int_actual = v.bob_toggle_int == 0 ? 1 : 0;",
					"variable.wwj_bob = (q.is_on_ground && query.ground_speed > 0.2) ? (v.wwj_bob == 20 ? 20 : v.wwj_bob + 1) : (v.wwj_bob == 0 ? 0 : v.wwj_bob - 1);",
					"variable.bob_decay = Math.pow(v.wwj_bob/20,2);",
					"variable.r = 0.55;",
					"variable.a = 2;",
					"variable.x_axis = math.cos(query.modified_distance_moved * 28.5) * (v.r/v.a) * v.bob_decay * v.bob_toggle_int_actual;",
					"variable.x_clamp = Math.clamp(v.x_axis,-v.r/v.a,v.r/v.a);",
					"variable.y_axis = Math.sqrt(Math.clamp(Math.pow(v.r,2)-Math.pow((v.x_axis*v.a),2),0,v.r))+v.r;",
					"variable.y_extra = v.x_clamp != v.x_axis ? (Math.abs(v.x_axis)-(v.r/v.a))*2 : 0;",
					"variable.is_holding_weapon = query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:gun_weapon', 'yes:rpg7_weapon');",
					"variable.ak47_hold = query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:gun_weapon') && !query.is_sneaking && variable.shooting_int == 0;",
					"variable.ak47_hipfire = query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:gun_weapon') && !query.is_sneaking && variable.shooting_int > 0;",
					"variable.ak47_ads = (query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:gun_weapon') || query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:javelin_weapon')) && query.is_sneaking;",
					"variable.holding_smg = query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:smg');",
					"variable.holding_pistol = query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:pistol');",
					"variable.holding_sniper = query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:sniper');",
					"variable.holding_shotgun = query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:shotgun');",
					"variable.holding_dmr = query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:dmr');",
					"variable.holding_shotgun_last = query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:shotgun_last');",
					"variable.holding_explosive_weapon = query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:explosive_weapon');",
					"variable.holding_rpg = query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:rpg7_weapon');",
					"variable.holding_javelin = query.equipped_item_any_tag('slot.weapon.mainhand', 'yes:javelin_weapon');",
					"variable.score = query.scoreboard('pls_work');",
					"variable.score2 = query.scoreboard('pls_work2');",
					"variable.score3 = query.scoreboard('pls_work3');",
					"variable.b = -0.01;",
					"variable.recoil_active = 1;",
					"variable.recoilExp = (1-v.b)*Math.pow((v.b/(v.b-1)),q.anim_time)+v.b;",
					"variable.x_add = -1.98;",
					"variable.y_add = 1.30 ;",
					"variable.z_add = -0.23;",
					"variable.reload_anim_mult = 0.6666;"
				],
				"animate": [
					"weeweejuice_guns"
				]
			},
			"animations": {
				"weeweejuice_guns": "controller.animation.player.guns_attachables",
	  
				"weapon_hold_crouch_normalize": "animation.crouch_normalize",
				"weapon_hold_crouch_normalize_back": "animation.crouch_normalize_back",
				"weapon_hold_crouch_normalize_cont": "animation.crouch_normalize_cont",
				"weapon_hold_first_person": "animation.weapon_hold_first_person",
				"ak47_hold_normalize": "animation.ak47_hold_normalize",
				"ak47_hold": "animation.ak47_hold",
				"ak47_hipfire_back_normalize": "animation.ak47_hipfire_back_normalize",
				"ak47_hipfire_back": "animation.ak47_hipfire_back",
				"ak47_ads_back_normalize": "animation.ak47_ads_back_normalize",
				"ak47_ads_back": "animation.ak47_ads_back",
				"ak47_hipfire_normalize": "animation.ak47_hipfire_normalize",
				"ak47_hipfire": "animation.ak47_hipfire",
				"ak47_hipfire_hold_normalize": "animation.ak47_hipfire_hold_normalize",
				"ak47_hipfire_hold": "animation.ak47_hipfire_hold",
				"ak47_ads_to_hipfire_normalize": "animation.ak47_ads_to_hipfire_normalize",
				"ak47_ads_to_hipfire": "animation.ak47_ads_to_hipfire",
				"ak47_ads_normalize": "animation.ak47_ads_normalize",
				"ak47_ads": "animation.ak47_ads",
				"ak47_hipfire_to_ads_normalize": "animation.ak47_hipfire_to_ads_normalize",
				"ak47_hipfire_to_ads": "animation.ak47_hipfire_to_ads",
	  
				"rpg7_hipfire_to_reload_normalize": "animation.rpg7_hipfire_to_reload_normalize",
				"rpg7_hipfire_to_reload": "animation.rpg7_hipfire_to_reload_attachable",
				"hide_magazine": "animation.rpg_hide_both_rockets"
			},
			"render_controllers": [
				"controller.render.gun_body_normal"
			]
		}
	}
}