force_powers: type: item material: nether_star display name: <&b>Force give_forcepowers: type: command name: giveforce description: Gives you forcepowers usage: /giveforce [player] script: - if !: - define playerName - define playerToGive ].if_null[null]> - if <[playerToGive]> == null: - narrate "<&[error]>Can't find player by name '<&[emphasis]><[playerName]><&[error]>'!" - stop - if !<[playerToGive].inventory.contains_item[force_powers]>: - give force_powers player:<[playerToGive]> - else: - narrate "<&[error]>They already have force powers!" - stop - if !: - give force_powers - else: - narrate "<&[error]>You already have force powers!" switch_inventory_script: type: task script: - define target > #if they have the backpack opened - if <[target].has_flag[force_inv_open]>: #the contents to set here would be the original contents you stored to the noted backpack inventory's flag - define contents_to_set ].flag[original_contents]> #note the player's inventory as a backpack inventory (as it has all the contents of it, you can just list them when they're opening the backpack (see ln. 26)) - note <[target].inventory> as:forcepowers_inv_<[target].uuid> #unflag them - flag <[target]> force_inv_open:! - narrate "Switched back to your normal inventory." - else: #note a backpack inventory if a note doesn't already exist - note as:forcepowers_inv_<[target].uuid> if:!].exists> #store the inventory contents of the player inventory to the note's flag (see ln. 13) - flag ]> original_contents:<[target].inventory.list_contents> #the contents to set here would be the noted backpack inventory's contents - define contents_to_set ].list_contents.first[36]> #flag them - flag <[target]> force_inv_open - narrate "Switched to your force inventory" #save the (changed) netherstar that they use to switch - define old_slot_force <[target].item_in_hand> #clear the player's inventory and set your predefined contents - inventory set o: slot:1 - inventory set o:<[contents_to_set]> slot:1 #change their forcepower item with the changed force power item - if <[target].inventory.find_item[force_powers]> > 0: - inventory set o:<[old_slot_force]> slot:<[target].inventory.find_item[force_powers]> - adjust <[target]> item_slot:<[target].inventory.find_item[force_powers]> - else: - inventory set o:<[old_slot_force]> slot:1 forcepower_input_script: type: world events: on player right clicks block with:*_spawn_egg flagged:force_inv_open: - determine cancelled on player right clicks block with:force_powers: - ratelimit 1t - if !: - run switch_inventory_script - stop - if && not matches : - stop - run switch_inventory_script on player right clicks player with:force_powers: - ratelimit 1t - run switch_inventory_script on player drops force_powers: - determine cancelled on player picks up item flagged:force_inv_open: - determine cancelled on player drops item flagged:force_inv_open: - determine cancelled on player left clicks block with:force_powers: - if == DROP: - narrate 3000202 - stop - narrate 2 - if : - run ]> - else: - narrate "<&3>- Select a Force Power before casting!" - determine cancelled on player damages entity with:force_powers: - if : - run ]> - else: - narrate "<&3>- Select a Force Power before casting!" - determine cancelled on player damages block with:force_powers: - if : - run ]> - else: - narrate "<&3>- Select a Force Power before casting!" - determine cancelled after player inventory slot changes flagged:force_inv_open: - if == : - if > 9: - if < 1 || > 9: - if < 37: - define slot1_item - inventory set origin: slot:1 - inventory set origin:<[slot1_item]> slot: - else: - narrate "<&[error]>You seem to have encountered a bug. Please contact an administrator! ERROR CODE: 0002" - stop - else: - inventory set origin: slot: - inventory set origin: slot: - adjust item_slot: on player clicks in inventory flagged:force_inv_open: - if matches : - determine cancelled on player swaps items offhand:force_powers flagged:force_inv_open: - determine cancelled on player swaps items flagged:force_inv_open: - determine cancelled after player scrolls their hotbar flagged:force_inv_open: - define force_power force_].display.strip_color.to_lowercase||force> - define force_power_slot - narrate <[force_power_slot]> - if <[force_power]> == force_force || ].material> == : - adjust item_slot:<[force_power_slot]> - stop - flag equipped_force:<[force_power]> - narrate <[force_power]> - narrate <[force_power_slot]> - inventory adjust slot:<[force_power_slot]> "display:<&b>Force <&f>[].display><&f>]" - adjust item_slot:<[force_power_slot]> force_push: type: task script: - define target ;range=;raysize=0.35]||null> - if <[target]> != null && (<[target].is_player> || <[target].is_mob> || <[target].is_npc>): - ratelimit - itemcooldown duration: - push <[target]> origin:<[target].location> destination:<[target].location.with_pose[].forward[]> no_rotate speed: duration: - flag player.force.statistics.cast_push:++ force_pull: type: task script: - define target ;range=;raysize=0.35]||null> - if <[target]> != null && (<[target].is_player> || <[target].is_mob> || <[target].is_npc>): - ratelimit - itemcooldown duration: - push <[target]> origin:<[target].location> destination: no_rotate speed: duration: - flag player.force.statistics.cast_pull:++ force_heal: type: task script: - ratelimit - itemcooldown duration: - cast slow amplifier:1 duration: no_clear no_icon hide_particles - define playerLoc - flag healing - flag player.force.statistics.cast_heal:++ - define target ;range=;raysize=0.2]||> - if <[target]> != && (<[target]> != null || (<[target].is_player> || <[target].is_mob> || <[target].is_npc>)): - repeat : - wait - if ! || ]> > 0.5: - cast slow remove - flag healing:! - stop - define target ;range=;raysize=0.15]||> - if <[target]> != null || (<[target].is_player> || <[target].is_mob> || <[target].is_npc>): - heal <[target]> - narrate "healing target: <[target].name>" - else if <[target]> == : - repeat : - wait - if ! || ]> > 0.5: - cast slow remove - flag healing:! - stop - heal <[target]> - narrate "healing target: <[target].name>" force_choke: type: task script: - define target ;range=]||> - if <[target]> != null && (<[target].is_player> || <[target].is_mob> || <[target].is_npc>): - ratelimit - itemcooldown duration: - flag player.force.statistics.cast_choke:++ - cast slow <[target]> duration: amplifier:3 hide_particles:true no_icon:true no_clear - cast slow duration: amplifier:1 hide_particles:true no_icon:true no_clear - wait 0.25s - repeat : - hurt <[target]> cause:Magic - wait force_levitate: type: task script: - define target ;range=;raysize=0.35]||null> - if <[target]> != null && (<[target].is_player> || <[target].is_mob> || <[target].is_npc>): - ratelimit - itemcooldown duration: - cast levitation <[target]> amplifier: duration: hide_particles no_icon no_clear - adjust <[target]> speed:0 - flag player.force.statistics.cast_levitate:++ force_leap: type: task script: - ratelimit - itemcooldown duration: - push origin: destination:]> speed: duration: no_rotate - flag player.force.statistics.cast_leap:++ force_blinding: type: task script: - define target ;range=;raysize=0.35]||null> - if <[target]> != null: - ratelimit - itemcooldown duration: - flag player.force.statistics.cast_blinding:++ - if <[target].is_player>: - cast blindness <[target]> amplifier: duration: hide_particles no_icon no_ambient no_clear - if <[target].is_mob>: - adjust <[target]> is_aware:false - hurt 0.01 <[target]> - wait - adjust <[target]> is_aware:true - if <[target].is_npc> && <[target].has_trait[sentinel]>: - define <[target].range> original_range - adjust <[target]> range:0 - wait - if <[original_range]> == 0: - adjust <[target]> range:20 - narrate "Targetting npcs might be broken. If it doesnt work, contact JustinS_2006" - else: - adjust <[target]> range:<[original_range]> force_stun: type: task script: - define target ;range=;raysize=0.35]||null> - if <[target]> != null && (<[target].is_player> || <[target].is_mob> || <[target].is_npc>): - ratelimit - itemcooldown duration: - adjust <[target]> speed:].div[5]> - cast jump <[target]> duration: amplifier:150 hide_particles:true no_clear:true no_icon:true - cast confusion <[target]> duration: amplifier:10 hide_particles:true no_clear:true no_icon:true - wait - adjust <[target]> speed:].div[4]> - wait - adjust <[target]> speed:].div[2.5]> - wait - adjust <[target]> speed:0.1 forcepowers_inventory: type: inventory inventory: chest title: Force_Powers gui: false slots: - [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] - [] [] [] [] [] [] [] [] [] player_movement_detection: type: world events: on player jumps flagged:healing: - flag player healing:! give_powers: type: command name: givepowers description: coolio usage: /givepowers script: - if == 1: - define playerName - define playerToGive ].if_null[null]> - if <[playerToGive]> == null: - narrate "<&[error]>Can't find player by name '<&[emphasis]><[playerName]><&[error]>'!" - stop - if !<[playerToGive].has_flag[force_inv_open]>: - run switch_inventory_script def.def_target:<[playerToGive]> - give item_force_push player:<[playerToGive]> - give item_force_pull player:<[playerToGive]> - give item_force_heal player:<[playerToGive]> - give item_force_choke player:<[playerToGive]> - give item_force_levitate player:<[playerToGive]> - give item_force_leap player:<[playerToGive]> - give item_force_blinding player:<[playerToGive]> - give item_force_stun player:<[playerToGive]> - else if > 1: - narrate "<&[error]>Incorrect usage! Use: /givepowers [player]" - stop - else if : - if == null: - narrate "<&[error]>Can't find this player??? ERROR CODE: 0003" - stop - if !<[playerToGive].has_flag[force_inv_open]>: - run switch_inventory_script - give item_force_push - give item_force_pull - give item_force_heal - give item_force_choke - give item_force_levitate - give item_force_leap - give item_force_blinding - give item_force_stun initialize_variables: type: command name: initializeforcevariables description: run me when using the plugin for the first time usage: /initializeforcevariables script: - narrate "Initializing force variables. Don't run me again, ever, unless JustinS_2006 tells you to do so or you want to reset all variables to their original value" - define push - flag <[push]> variables.base_strength:4 - flag <[push]> variables.base_duration:2 - flag <[push]> variables.base_cooldown:3 - flag <[push]> variables.base_range:11 - flag <[push]> variables.energy_cost:3 - flag <[push]> variables.display_colour:blue - define pull - flag <[pull]> variables.base_strength:2 - flag <[pull]> variables.base_duration:2 - flag <[pull]> variables.base_cooldown:3 - flag <[pull]> variables.base_range:15 - flag <[pull]> variables.energy_cost:3 - flag <[pull]> variables.display_colour:blue - define heal - flag <[heal]> variables.base_strength:2 - flag <[heal]> variables.base_duration:8 - flag <[heal]> variables.base_cooldown:12 - flag <[heal]> variables.base_range:8 - flag <[heal]> variables.energy_cost:8 - flag <[heal]> variables.display_colour:blue - define choke - flag <[choke]> variables.base_strength:1 - flag <[choke]> variables.base_duration:5 - flag <[choke]> variables.base_cooldown:8 - flag <[choke]> variables.base_range:13 - flag <[choke]> variables.energy_cost:6 - define levitate - flag <[levitate]> variables.base_strength:1 - flag <[levitate]> variables.base_duration:3 - flag <[levitate]> variables.base_cooldown:7 - flag <[levitate]> variables.base_range:13 - flag <[levitate]> variables.energy_cost:5 - define leap - flag <[leap]> variables.base_strength:0.9 - flag <[leap]> variables.base_duration:0.8 - flag <[leap]> variables.base_cooldown:4 - flag <[leap]> variables.base_range:6 - flag <[leap]> variables.energy_cost:4 - define blind - flag <[blind]> variables.base_strength:1 - flag <[blind]> variables.base_duration:3 - flag <[blind]> variables.base_cooldown:7 - flag <[blind]> variables.base_range:13 - flag <[blind]> variables.energy_cost:5 - define stun - flag <[stun]> variables.base_strength:1 - flag <[stun]> variables.base_duration:5 - flag <[stun]> variables.base_cooldown:5 - flag <[stun]> variables.base_range:11 - flag <[stun]> variables.energy_cost:5 # The following scripts are item scripts for each force power: item_force_push: type: item material: allay_spawn_egg mechanisms: custom_model_data: 100 display name: <&b>Push ##lore: item_force_pull: type: item material: axolotl_spawn_egg mechanisms: custom_model_data: 100 display name: <&b>Pull ##lore: item_force_heal: type: item material: bat_spawn_egg mechanisms: custom_model_data: 100 display name: Heal ##lore: item_force_choke: type: item material: bee_spawn_egg mechanisms: custom_model_data: 100 display name: Choke ##lore: item_force_levitate: type: item material: blaze_spawn_egg mechanisms: custom_model_data: 100 display name: <&b>Levitate ##lore: item_force_leap: type: item material: camel_spawn_egg mechanisms: custom_model_data: 100 display name: Leap ##lore: item_force_blinding: type: item material: cat_spawn_egg mechanisms: custom_model_data: 100 display name: Blinding ##lore: item_force_stun: type: item material: cave_spider_spawn_egg mechanisms: custom_model_data: 100 display name: Stun ##lore: