rpg_arrow: type: item debug: false material: arrow display name: RPG Ammo lore: - <&a>Fire this - <&b>If you like explosions - <&c>(Requires RPG Launcher) recipe: - i@arrow|i@tnt|i@tnt - i@air|i@air|i@air - i@air|i@air|i@air rpg_bow: type: item debug: false material: bow display name: RPG LAUNCHER lore: - <&c>Launches missles - <&c>(Requires RPG ammo) recipe: - i@bow|i@tnt|i@tnt - i@tnt|i@diamond_block|i@tnt - i@air|i@air|i@air rpg_arrow_determine_type: type: task debug: false script: - if == i@rpg_arrow { - flag player arrowtype:rpg } else { - narrate "<&c>You've loaded the wrong arrow type, most load an explosive round!" - determine cancelled } - flag player arrows:|: duration:10s - flag player arrows:|: duration:10s rpg_arrow_world: type: world debug: false events: on player shoots bow: - flag player arrowtype:! - define item ]> - adjust %item% quantity:1 save:myitem - if == i@rpg_bow { - inject rpg_arrow_determine_type } on projectile hits block: - if == null queue clear - if matches player { - if !]> - run rpg_arrow_handler_internal def:| as: } on arrow damages entity: - if matches player { - if !]> queue clear - if == sharp determine - if == damaged determine - run rpg_arrow_handler_internal def:|null as: } rpg_arrow_handler_internal: type: task debug: false speed: 2t script: - ^if == rpg { - define t1 ,,, - explode %50% power:10 - spawn %1% rpg[rpg_item=i@rpg=true,false,%t1%,,,|0];velocity=0,0,0,] - spawn %1% rpg[rpg_item=i@firework[rpg=true,false,%t1%,,,|0];velocity=0,0,0,] save:myrpg - if %2% != null remove %2% - wait 5t - adjust detonate }