Trouble with double ore drop ability

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

sillypop

Member
Oct 25, 2024
3
1
3
22
so ive been using the skript docs, using an example "one mine of any ore:" but for some reason when I tried to try in on an actual server to debug it, it said it was invalid. am I using this argument wrong? or is there another argument I can use that actually works?


Code:
on mine of any ore:
    if {level::%player%} >= 2:
        drop drops of block
        if {fortunate_alert::%player%} = true:
            message "&a✔ &eYour Level &e&l2 &eability has been activated: &bFortunate" to player
 
Hey, Ive tried it myself and you are right, the event doesnt work, so i think your best choice is to go 1 by 1 since I didnt find anything better that would work for you.
 
Code:
on skript load: 
    set {ores_doubled::*} to iron ore, deepslate iron ore, gold ore, deepslate gold ore, diamond ore, deepslate diamond ore, emerald ore, deepslate emerald ore, nether gold ore, copper ore, deepslate copper ore
    set {items_doubled::*} to diamond, raw gold, emerald, raw iron, coal #The items that are dropped as a result of mining the ores being increased are required for this code to work.

For the code to work, and not to have to make a if or else statement for each drop you want doubled you need to have the names of the ore itself and the item it drops.

Code:
on block break:
    if {ores_doubled::*} contains event-block:
        wait 1 ticks #Needs to have a small wait to let the item properly load in as a drop
        loop all dropped items in radius 2 of event-block:
            if {items_doubled::*} contains item of loop-value:
                set {_droppeditem} to type of item of loop-value #Has to be parsed specifically as an item otherwise this will not work
                drop 1 of {_droppeditem} at location of loop-value #1 can be changed to any value you want, it can be 0! that means you wont get any extra ores :( 
                if {fortunate_alert::%player%} = true:
                    message "&a✔ &eYour Level &e&l2 &eability has been activated: &bFortunate" to player
                    stop loop #always stop your loops when you no longer need them :)
                stop loop #always stop your loops when you no longer need them :)