1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Count blocks broken in lore

Discussion in 'Skript' started by GTEnder, Jul 13, 2021.

Thread Status:
Not open for further replies.
  1. GTEnder

    GTEnder Member

    Joined:
    Jul 13, 2021
    Messages:
    2
    Likes Received:
    0
    Hi, i'm trying to make a prison server that gives you an unbreakable pickaxe, and the pick gets better the more blocks you mine.

    The problem i have is that i don't know how to count the blocks and change the lore of the pick so you can see how many blocks you mined, any suggestions?

    Please explain everything thoroughly as i'm new to skript.
     
  2. Best Answer:
    Post #2 by AHappyLittleSloth, Jul 14, 2021
  3. AHappyLittleSloth

    Joined:
    Apr 22, 2020
    Messages:
    48
    Likes Received:
    4
    I'll come back and explain later since I'm at work but here is the skript:

    Code (Text):
    1. command /pick:
    2.   description: Gives the user a diamond pick that counts blocks mined
    3.   trigger:
    4.     give player 1 diamond pickaxe with no nbt named "&bDiamond Pickaxe" with lore " ", "&7Blocks Mined: &e0", and "&7Ores Mined: &a0"
    5.     set {blocksmined::%player%} to 0
    6.     set {oresmined::%player%} to 0
    7.  
    8.  
    9. on item damage:
    10.   if name of player's tool is "&bDiamond Pickaxe":
    11.     cancel event
    12.  
    13. on mine:
    14.   if name of player's tool is "&bDiamond Pickaxe":
    15.     add 1 to {blocksmined::%player%}
    16.     if event-block is ore:
    17.       add 1 to {oresmined::%player%}
    18.     set lore of player's tool to " ", "&7Blocks Mined: &e%{blocksmined::%player%}%", and "&7Ores Mined: &a%{oresmined::%player%}%"
    19.  
    I think it's pretty self explanatory
     
  4. GTEnder

    GTEnder Member

    Joined:
    Jul 13, 2021
    Messages:
    2
    Likes Received:
    0
    Thank you! I could read everything with no issue, tested it and works just fine!
     
  5. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    Hey, I marked this thread as solved and marked the best solution! To keep the forum tidy, we ask everyone to mark a solved thread as such (In the upper right corner → "Thread options"), also you can mark the best answer to give the user a small thank you and additionally this will be displayed at the top which helps others to find the best solution directly.
     
  6. Riiee

    Riiee Member

    Joined:
    Aug 25, 2021
    Messages:
    3
    Likes Received:
    0
    I know this an old thread, but better than create new one i think
    Rather than give custom pickaxe with lore, how can i apply this to all vanilla item pickaxe automaticly, so if player hold any pickaxe and mine any block, it will set a new lore block mined
    And how to combine with lore item durabilty? Have check ur answer too at https://forums.skunity.com/threads/lore-durability.14148/#post-58051 but it is set to integer, not default durabilty
    So the line 1 is brock break and line 2 is durabilty

    Code (Text):
    1. on mine:
    2.   if tool of player is a pickaxe:
    3.     add 1 to {blocksmined::%player%}
    4.     set line 1 of lore of player's tool to "&7Blocks Mined: &e%{blocksmined::%player%}%"
    5.    
     
Thread Status:
Not open for further replies.

Share This Page

Loading...