# ____ _ _ # / ___| | || | # | | | || |_ # | |___ |__ _| # \____| |_| # -- Have a little more fun with explosions # -- By: ShaneBee # -- VERSION: 2.0 options: prefix: &7[&bC4&7] c4-strength: 7 #! This is how powerful of an explosion the c4 will put off !# grenade-strength: 3 #! This is how powerful of an explosion the grenade will put off !# stun-strength: 3 #! This is how much damage a stun grenade will do to entities !# #! I realized that the c4 recipe includes skeleton skulls which are not generally obtainable in MC, so I added this !# dropSkulls: true #! change this to false if you do not want skeletons to drop skulls on death !# dropChance: 75 #! Percentage chance of skeletons dropping skulls on death !# #! === DO NOT EDIT BELOW THIS LINE OR SUPPORT WILL BE LOST === !# #! --- Loading Recipes --- !# on skript load: set {-c4::detonator} to 1 player head named "<##33FFA2>Detonator" add nbt from "{SkullOwner:{Id:[I;850743030,-894220147,-2036941450,-823750908],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGUwN2FjMDJkOWU5NDdlNTYyYTdmNzM5NTJjMjllZjY4MmExZmM2MGRhMTE1Y2JjODE1NGE1YzRiOTkxMjBlOSJ9fX0=""}]}}}" to nbt of {-c4::detonator} set lore of {-c4::detonator} to "", "<##B05A3A>BOOM TIME &7- &a3 Charges", "&7- &bPlace your C4 charges" and "&7- &6Right click to detonate charges" set tag "c4" of nbt of {-c4::detonator} to "detonator" register new shaped recipe for {-c4::detonator} using emerald, emerald, emerald, book, book, book, redstone, redstone and redstone with id "c4:detonator" set {-c4::c4} to 3 of player head named "<##FAD819>C4" add nbt from "{SkullOwner:{Id:[I;1833486433,77415117,-1965145857,1385826899],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzQyNzQ3NTQ4OTE4NzMxZDY1ZDhlNTNlNWY5YTM3Nzg2YjdiOTcxNzFjYTcyNDA4ZDlhYTgzMzgxNDNmNTM5In19fQ==""}]}}}" to nbt of {-c4::c4} set lore of {-c4::c4} to "", "&cSet upto 3 charges", "&7- &2Use your detonator to" and " &2detonate your charges" set tag "c4" of nbt of {-c4::c4} to "c4" register new shaped recipe for {-c4::c4} using paper, paper, paper, tnt, skeleton head, tnt, paper, paper and paper with id "c4:c4" set {-c4::grenade} to player head named "<##19C7FA>Grenade" add nbt from "{SkullOwner:{Id:[I;880357396,1879261975,-2030399572,572816016],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2U1NWM1YWJjZTdhNzkyNjRhNDg5MmQ2ODgwNmVhYWZlMzcwYTBlNGRkMjZmNTYxOTFmN2MxODhmMDFlZDcyNiJ9fX0=""}]}}}" to nbt of {-c4::grenade} set lore of {-c4::grenade} to "", "&bRight-Click to throw grenade" set tag "c4" of nbt of {-c4::grenade} to "grenade" register new shaped recipe for {-c4::grenade} using air, air, air, redstone, poisonous potato, tnt, air, air and air with id "c4:grenade" set {-c4::stungrenade} to player head named "<##847AFC>Stun Grenade" add nbt from "{SkullOwner:{Id:[I;-869745275,1293108115,-2000780210,1190988749],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjgyYTUyY2JkZjM5Nzg2YTJiYTVmNGY5OGFjYWE0OGRiOWVjYjMwYWY5MzA1ZDU1MTRiZjRiMjFjYWU4YjFhOSJ9fX0=""}]}}}" to nbt of {-c4::stungrenade} set lore of {-c4::stungrenade} to "", "&bRight-Click to throw stun grenade" set tag "c4" of nbt of {-c4::stungrenade} to "stun_grenade" register new shaped recipe for {-c4::stungrenade} using air, air, air, redstone, poisonous potato, tnt, cactus, cactus and cactus with id "c4:stun_grenade" #! --- Crafting Permissions --- !# on craft: if nbt of item has tag "c4": set {_tag} to tag "c4" of nbt of item if player does not have permission "c4.craft.%{_tag}%": cancel event send "{@prefix} - &cYou do not have permission to craft grenades" to player #! === Commands === !# command /c4 [] []: trigger: if player has permission "c4.admin": if arg-1 is "detonator": give player 1 of {-c4::detonator} else if arg-1 is "charges": give player 3 of {-c4::c4} else if arg-1 = "grenade": give player arg-2 of {-c4::grenade} else if arg-1 = "stun_grenade": give player arg-2 of {-c4::stungrenade} else: send "{@prefix} &e/c4 detonator &r- Receive 1 detonator" to player send "{@prefix} &e/c4 charges &r- Receive 3 c4 charges" to player send "{@prefix} &e/c4 grenade &7<&bamount&7> &r- Receive grenades" to player send "{@prefix} &e/c4 stungrenade &7<&bamount&7> &r- Receive stun grenades" to player else: send "[&9C4&r] - &cYou do not have permission for this command" to player on tab complete of "/c4": set tab completions for position 1 to "detonator", "charges", "grenade", "stun_grenade" if tab arg-1 = "grenade" or "stun_grenade": set tab completions for position 2 to "" on death of skeleton: if {@dropSkulls} is true: chance of {@dropChance}%: drop skeleton skull at victim #! === C4 === !# function sendPlacedLoc(loc: location, p: player, c: number): set {_x} to floor(x coord of {_loc}) set {_y} to floor(y coord of {_loc}) set {_z} to floor(z coord of {_loc}) set {_t} to "&7C4 charge placed at:%nl%&7x: &b%{_x}%%nl%&7y: &b%{_y}%%nl%&7z: &b%{_z}%" send formatted "{@prefix} &7Charge &a##%{_c}%&7 has been placed!" to {_p} #! --- Setting Charges --- !# on place of player head or player wall head: if nbt of player's tool has tag "c4": if string tag "c4" of nbt of player's tool = "c4": if size of {c4::explode::%uuid of player%::*} < 3: set {_loc} to location of event-block add {_loc} to {c4::explode::%uuid of player%::*} set {_s} to size of {c4::explode::%uuid of player%::*} sendPlacedLoc({_loc}, player, {_s}) else: cancel event send "{@prefix} &cAll 3 charges placed, use your detonator to detonate charges!" #! --- Detonating Charges --- !# on right-click holding a player head: if nbt of player's tool has tag "c4": if string tag "c4" of nbt of player's tool = "detonator": cancel event if {c4::explode::%uuid of player%::1} is set: send "{@prefix} &2&lBOOM TIME" to player wait 2 seconds loop {c4::explode::%uuid of player%::*}: if block at loop-value is a player head or a player wall head: set block at loop-value to air create an explosion of force {@c4-strength} at loop-value wait 3 ticks delete {c4::explode::%uuid of player%::*} else: send "{@prefix} &c&lYou have no charges set." #! === Grenades === !# #! --- Throw Grenades --- !# on right-click: if nbt of player's tool has tag "c4": if string tag "c4" of nbt of player's tool = "grenade": cancel event remove 1 of item from player's inventory make player shoot a dropped player head with speed 2 set {_p} to last shot entity send "P: %{_p}%" set item of {_p} to {-c4::grenade} set short tag "PickupDelay" of nbt of {_p} to 32767 wait 3 seconds create explosion of force {@grenade-strength} at {_p} kill {_p} #! --- Throw Stun Grenades --- !# on right-click: if nbt of player's tool has tag "c4": if string tag "c4" of nbt of player's tool = "stun_grenade": cancel event make the player shoot a snowball at speed 2 set metadata tag "stun_grenade" of last shot projectile to true remove 1 of item from player's inventory on projectile hit: if projectile is a snowball: if metadata tag "stun_grenade" of projectile is true: spawn dropped player head at event-location: set velocity of entity to vector(0,0,0) set short tag "PickupDelay" of nbt of entity to 32767 set item of entity to {-c4::stungrenade} set {_e} to last spawned entity wait 3 second set {_l} to location of {_e} kill {_e} create fake explosion at {_l} loop entities in radius 8 around {_l}: apply blindness to loop-entity for 5 seconds apply nausea to loop-entity for 7 seconds damage loop-entity by {@stun-strength} loop 20 times: draw 1000 of firework at {_l} with offset vector(2,1.5,2) with extra 0 wait 1 ticks