Skript not giving copper when it should

  • 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!

Syph

Member
Apr 20, 2021
2
0
1
23
Hey, so I'm making a skript that makes it so that whenever a player mines a block, they get the item in their inventory and it also has compatibility with another multiplier skript and a potential autosmelter skript. Point is, for some reason, whilst all other blocks work, for some reason, copper doesnt. I've already tried giving copper in the same way using a command and it doesnt work, but this one doesnt. Here's a snippet of my code:

Code:
    else if event-block is copper ore:

        set {_drops::*} to drops of block with player's tool

        set {_multi} to {multiplier::%player's uuid%::multiplier} * 1

        clear drops

        if {_drops::*} contains ("raw copper" parsed as an item):

            if {tools::%player's uuid%::smelter} is true:

                remove ("raw copper" parsed as an item) from {_drops::*}

                add {_multi} of ("copper ingot" parsed as an item) to {_drops::*}

                give player {_drops::*}

            else:

                remove ("raw copper" parsed as an item) from {_drops::*}

                add {_multi} of ("raw copper" parsed as an item) to {_drops::*}

                give player {_drops::*}

Any help is appreciated!
 
Last edited:
Hi, please, next time try to use </> button, isn't simple for me to understand how the code is write.

if event-block is copper ore or deepslate copper ore:

"if {_drops::*} contains ("raw copper" parsed as an item)" this type of expression not work
i tried without it and after that you have another line of code with same expression: remove ("raw copper" parsed as an item) from {_drops::*}
This not work too and give to the player raw copper (drops x multiplier 4 copper x 3) and the copper ingots too (but only copper ingot x multiplier copper ingot x 3), here you need (amount x multiplier) x copper ingot [if multiplier not replace fortune, if does you need to remove multiplier from here]

i used: remove {_drops::*} from {_drops::*} and worked

But remain "if {_drops::*} contains ("raw copper" parsed as an item)" and the ingots multiplier problem

Code:
on break:
    set {multiplier::%player's uuid%::multiplier} to 3
    set {tools::%player's uuid%::smelter} to true
    broadcast " "
    if event-block is copper ore or deepslate copper ore:
        set {_drops::*} to drops of block with player's tool
        set {_multi} to {multiplier::%player's uuid%::multiplier} * 1
        clear drops
#        if {_drops::*} contains ("raw copper" parsed as an item):
        if {tools::%player's uuid%::smelter} is true:
            broadcast "Smelter Contition"
            loop {_drops::*}:
                broadcast "&c1 %loop-value%"
#            remove ("raw copper" parsed as an item) from {_drops::*}# doesn't remove nothing
            remove {_drops::*} from {_drops::*}
            loop {_drops::*}:
                broadcast "&c2 %loop-value%"
            add {_multi} of ("copper ingot" parsed as an item) to {_drops::*}# add wrong quantity of copper ingots
            loop {_drops::*}:
                if loop-value contain "raw copper":
                    remove loop-value from {_drops::*}
                broadcast "&c3 %loop-value%"
            give player {_drops::*}
            loop {_drops::*}:
                broadcast "&c4 %loop-value%"
        else if {tools::%player's uuid%::smelter} is false:
            broadcast "Raw Contition"
            remove ("raw copper" parsed as an item) from {_drops::*}
            add {_multi} of ("raw copper" parsed as an item) to {_drops::*}
            give player {_drops::*}
        else if {tools::%player's uuid%::smelter} isn't set:
            broadcast "Smelter Contition"
            remove ("raw copper" parsed as an item) from {_drops::*}
            add {_multi} of ("raw copper" parsed as an item) to {_drops::*}
            broadcast "raw copper"
            give player {_drops::*}
#        loop {_drops::*}:
#            broadcast "&c%loop-value%"

on skript stop:
    delete {multiplier::*}
    delete {tools::*}
 
Last edited: