Solved Mining skript not working

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

JarBinks

Member
Jun 28, 2023
17
0
1
24
Hi, I have a skript that when certain pickaxes mine blocks, it puts the blocks in the players inventories. It works for all the pickaxes execpt for the coal pick, iron pick, and the diamond pick. Also, how do I make it so no other blocks will drop, only if it gets mined by the correct picaxe.

Code:
# Normal pickaxes
on break:
    if event-player is holding a wooden pickaxe:
        if the name of the player's tool is "wood pick":
            if event-block is stone:
                clear drops
                give 1 of cobblestone to player
            else:
                clear drops
    else if event-player is holding a stone pickaxe:
        if the name of the player's tool is "stone pick":
            if event-block is stone:
                clear drops
                give 1 of cobblestone to player
            if event-block is coal ore:
                clear drops
                give 1 of coal to player
            else:
                clear drops
    else if event-player is holding a stone pickaxe:
        if the name of the player's tool is "&8&lcoal pick":
            if event-block is stone:
                clear drops
                give 1 of cobblestone to player
            if event-block is coal ore:
                clear drops
                give 1 of coal to player
            if event-block is iron ore:
                clear drops
                give 1 of raw iron to player
            else:
                clear drops
    else if event-player is holding a iron pickaxe:
        if the name of the player's tool is "iron pick":
            if event-block is stone:
                clear drops
                give 1 of cobblestone to player
            if event-block is coal ore:
                clear drops
                give 1 of coal to player
            if event-block is iron ore:
                clear drops
                give 1 of raw iron to player
            if event-block is gold ore:
                clear drops
                give 1 of raw gold to player
            else:
                clear drops
    else if event-player is holding a gold pickaxe:
        if the name of the player's tool is "&6&lgold pick":
            if event-block is stone:
                clear drops
                give 1 of cobblestone to player
            if event-block is coal ore:
                clear drops
                give 1 of coal to player
            if event-block is iron ore:
                clear drops
                give 1 of raw iron to player
            if event-block is gold ore:
                clear drops
                give 1 of raw gold to player
            if event-block is lapis ore:
                clear drops
                give 1 of lapis lazuli to player
            else:
                clear drops
    else if event-player is holding a diamond pickaxe:
        if the name of the player's tool is "lapis pick":
            if event-block is stone:
                clear drops
                give 1 of cobblestone to player
            if event-block is coal ore:
                clear drops
                give 1 of coal to player
            if event-block is iron ore:
                clear drops
                give 1 of raw iron to player
            if event-block is gold ore:
                clear drops
                give 1 of raw gold to player
            if event-block is lapis ore:
                clear drops
                give 1 of lapis lazuli to player
            if event-block is diamond ore:
                clear drops
                give 1 of diamond to player
            else:
                clear drops
    else if event-player is holding a diamond pickaxe:
        if the name of the player's tool is "diamond pick":
            if event-block is stone:
                clear drops
                give 1 of cobblestone to player
            if event-block is coal ore:
                clear drops
                give 1 of coal to player
            if event-block is iron ore:
                clear drops
                give 1 of raw iron to player
            if event-block is gold ore:
                clear drops
                give 1 of raw gold to player
            if event-block is lapis ore:
                clear drops
                give 1 of lapis lazuli to player
            if event-block is diamond ore:
                clear drops
                give 1 of diamond to player
            if event-block is ancient debris:
                clear drops
                give 1 of ancient debris to player
            else:
                clear drops
    else if event-player is holding a netherite pickaxe:
        if the name of the player's tool is "neth pick":
            if event-block is stone:
                clear drops
                give 1 of cobblestone to player
            if event-block is coal ore:
                clear drops
                give 1 of coal to player
            if event-block is iron ore:
                clear drops
                give 1 of raw iron to player
            if event-block is gold ore:
                clear drops
                give 1 of raw gold to player
            if event-block is lapis ore:
                clear drops
                give 1 of lapis lazuli to player
            if event-block is diamond ore:
                clear drops
                give 1 of diamond to player
            if event-block is ancient debris:
                clear drops
                give 1 of ancient debris to player
            else:
                clear drops
 
I figured it out, the problem was
Code:
    else if event-player is holding a stone pickaxe:
        if the name of the player's tool is "stone pick":
            if event-block is stone:
                clear drops
                give 1 of cobblestone to player
            if event-block is coal ore:
                clear drops
                give 1 of coal to player
            else:
                clear drops
    else if event-player is holding a stone pickaxe:
        if the name of the player's tool is "&8&lcoal pick":
            if event-block is stone:
                clear drops
                give 1 of cobblestone to player
            if event-block is coal ore:
                clear drops
                give 1 of coal to player
            if event-block is iron ore:
                clear drops
                give 1 of raw iron to player
            else:
                clear drops
I needed to do
Code:
 else if the name of the player's tool is "&8&lcoal pick":
and take away the
Code:
else if event-player is holding a stone pickaxe:
the second time it comes up.
 
I figured it out, the problem was
Code:
    else if event-player is holding a stone pickaxe:
        if the name of the player's tool is "stone pick":
            if event-block is stone:
                clear drops
                give 1 of cobblestone to player
            if event-block is coal ore:
                clear drops
                give 1 of coal to player
            else:
                clear drops
    else if event-player is holding a stone pickaxe:
        if the name of the player's tool is "&8&lcoal pick":
            if event-block is stone:
                clear drops
                give 1 of cobblestone to player
            if event-block is coal ore:
                clear drops
                give 1 of coal to player
            if event-block is iron ore:
                clear drops
                give 1 of raw iron to player
            else:
                clear drops
I needed to do
Code:
 else if the name of the player's tool is "&8&lcoal pick":
and take away the
Code:
else if event-player is holding a stone pickaxe:
the second time it comes up.
Good work!