ChunkerDunkers Posted June 3, 2021 Share Posted June 3, 2021 This is my skript for the blast enchantment. Is there a way to simplify this code? # # #Blast Enchantment# # # on break: if lore of player's tool contains "&cBlast I": cancel event loop blocks in radius 1 around the target block: if loop-block is yellow concrete: set loop-block to air drop 1 yellow concrete else if loop-block is sponge: set loop-block to air drop 1 sponge on break: if lore of player's tool contains "&cBlast II": cancel event loop blocks in radius 2 around the target block: if loop-block is yellow concrete: set loop-block to air drop 1 yellow concrete else if loop-block is sponge: set loop-block to air drop 1 sponge on break: if lore of player's tool contains "&cBlast III": cancel event loop blocks in radius 3 around the target block: if loop-block is yellow concrete: set loop-block to air drop 1 yellow concrete else if loop-block is sponge: set loop-block to air drop 1 sponge on break: if lore of player's tool contains "&cBlast IV": cancel event loop blocks in radius 4 around the target block: if loop-block is yellow concrete: set loop-block to air drop 1 yellow concrete else if loop-block is sponge: set loop-block to air drop 1 sponge on break: if lore of player's tool contains "&cBlast V": cancel event loop blocks in radius 5 around the target block: if loop-block is yellow concrete: set loop-block to air drop 1 yellow concrete else if loop-block is sponge: set loop-block to air drop 1 sponge # # #Blast Enchantment with Fortune# # # on break: tool of the player is enchanted with fortune 1 if lore of player's tool contains "&cBlast I": cancel event loop blocks in radius 1 around the target block: if loop-block is yellow concrete: set loop-block to air drop 2 yellow concrete else if loop-block is sponge: set loop-block to air drop 2 sponge on break: tool of the player is enchanted with fortune 1 if lore of player's tool contains "&cBlast II": cancel event loop blocks in radius 2 around the target block: if loop-block is yellow concrete: set loop-block to air drop 2 yellow concrete else if loop-block is sponge: set loop-block to air drop 2 sponge on break: tool of the player is enchanted with fortune 1 if lore of player's tool contains "&cBlast III": cancel event loop blocks in radius 3 around the target block: if loop-block is yellow concrete: set loop-block to air drop 2 yellow concrete else if loop-block is sponge: set loop-block to air drop 2 sponge on break: tool of the player is enchanted with fortune 1 if lore of player's tool contains "&cBlast IV": cancel event loop blocks in radius 4 around the target block: if loop-block is yellow concrete: set loop-block to air drop 2 yellow concrete else if loop-block is sponge: set loop-block to air drop 2 sponge on break: tool of the player is enchanted with fortune 1 if lore of player's tool contains "&cBlast V": cancel event loop blocks in radius 5 around the target block: if loop-block is yellow concrete: set loop-block to air drop 2 yellow concrete else if loop-block is sponge: set loop-block to air drop 2 sponge #-------# on break: tool of the player is enchanted with fortune 2 if lore of player's tool contains "&cBlast I": cancel event loop blocks in radius 1 around the target block: if loop-block is yellow concrete: set loop-block to air drop 3 yellow concrete else if loop-block is sponge: set loop-block to air drop 3 sponge on break: tool of the player is enchanted with fortune 2 if lore of player's tool contains "&cBlast II": cancel event loop blocks in radius 2 around the target block: if loop-block is yellow concrete: set loop-block to air drop 3 yellow concrete else if loop-block is sponge: set loop-block to air drop 3 sponge on break: tool of the player is enchanted with fortune 2 if lore of player's tool contains "&cBlast III": cancel event loop blocks in radius 3 around the target block: if loop-block is yellow concrete: set loop-block to air drop 3 yellow concrete else if loop-block is sponge: set loop-block to air drop 3 sponge on break: tool of the player is enchanted with fortune 2 if lore of player's tool contains "&cBlast IV": cancel event loop blocks in radius 4 around the target block: if loop-block is yellow concrete: set loop-block to air drop 3 yellow concrete else if loop-block is sponge: set loop-block to air drop 3 sponge on break: tool of the player is enchanted with fortune 2 if lore of player's tool contains "&cBlast V": cancel event loop blocks in radius 5 around the target block: if loop-block is yellow concrete: set loop-block to air drop 3 yellow concrete else if loop-block is sponge: set loop-block to air drop 3 sponge #-------# on break: tool of the player is enchanted with fortune 3 if lore of player's tool contains "&cBlast I": cancel event loop blocks in radius 1 around the target block: if loop-block is yellow concrete: set loop-block to air drop 4 yellow concrete else if loop-block is sponge: set loop-block to air drop 4 sponge on break: tool of the player is enchanted with fortune 3 if lore of player's tool contains "&cBlast II": cancel event loop blocks in radius 2 around the target block: if loop-block is yellow concrete: set loop-block to air drop 4 yellow concrete else if loop-block is sponge: set loop-block to air drop 4 sponge on break: tool of the player is enchanted with fortune 3 if lore of player's tool contains "&cBlast III": cancel event loop blocks in radius 3 around the target block: if loop-block is yellow concrete: set loop-block to air drop 4 yellow concrete else if loop-block is sponge: set loop-block to air drop 4 sponge on break: tool of the player is enchanted with fortune 3 if lore of player's tool contains "&cBlast IV": cancel event loop blocks in radius 4 around the target block: if loop-block is yellow concrete: set loop-block to air drop 4 yellow concrete else if loop-block is sponge: set loop-block to air drop 4 sponge on break: tool of the player is enchanted with fortune 3 if lore of player's tool contains "&cBlast V": cancel event loop blocks in radius 5 around the target block: if loop-block is yellow concrete: set loop-block to air drop 4 yellow concrete else if loop-block is sponge: set loop-block to air drop 4 sponge Hello, I'm Nolan! Cool Links Vote Please - bit.ly/3tMXajE MC Server - bit.ly/3hqYAOy Please leave a like if I helped! Link to comment Share on other sites More sharing options...
StarBunnie Posted June 3, 2021 Share Posted June 3, 2021 (edited) Alright I'm unsure if I'm wrong here but in theory after the on break you could check if the lore contains "Blast" then you add all the lines into a list loop through them to get the line with the "Blast X". Then you split this line by " " a space that way you can get the number or the enchantment level of blast. After that or before that even you can check the enchantment level of fortune on the players tool with https://skripthub.net/docs/?id=929 and done. Edit: Why even check for the fortune level is there an effect of it I'm missing? Edited June 3, 2021 by Starshinex3 1 Feel free to add me on discord if you: need help with plugins need help with skripts need to vent about something >[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]< Link to comment Share on other sites More sharing options...
nemonle Posted June 7, 2021 Share Posted June 7, 2021 you use a singular on break: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now