Solved Count blocks broken in lore

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

Status
Not open for further replies.

GTEnder

Member
Jul 13, 2021
2
0
1
24
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.
 
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.

I'll come back and explain later since I'm at work but here is the skript:

Code:
command /pick:
  description: Gives the user a diamond pick that counts blocks mined
  trigger:
    give player 1 diamond pickaxe with no nbt named "&bDiamond Pickaxe" with lore " ", "&7Blocks Mined: &e0", and "&7Ores Mined: &a0"
    set {blocksmined::%player%} to 0
    set {oresmined::%player%} to 0


on item damage:
  if name of player's tool is "&bDiamond Pickaxe":
    cancel event

on mine:
  if name of player's tool is "&bDiamond Pickaxe":
    add 1 to {blocksmined::%player%}
    if event-block is ore:
      add 1 to {oresmined::%player%}
    set lore of player's tool to " ", "&7Blocks Mined: &e%{blocksmined::%player%}%", and "&7Ores Mined: &a%{oresmined::%player%}%"

I think it's pretty self explanatory
 
I'll come back and explain later since I'm at work but here is the skript:

Code:
command /pick:
  description: Gives the user a diamond pick that counts blocks mined
  trigger:
    give player 1 diamond pickaxe with no nbt named "&bDiamond Pickaxe" with lore " ", "&7Blocks Mined: &e0", and "&7Ores Mined: &a0"
    set {blocksmined::%player%} to 0
    set {oresmined::%player%} to 0


on item damage:
  if name of player's tool is "&bDiamond Pickaxe":
    cancel event

on mine:
  if name of player's tool is "&bDiamond Pickaxe":
    add 1 to {blocksmined::%player%}
    if event-block is ore:
      add 1 to {oresmined::%player%}
    set lore of player's tool to " ", "&7Blocks Mined: &e%{blocksmined::%player%}%", and "&7Ores Mined: &a%{oresmined::%player%}%"

I think it's pretty self explanatory

Thank you! I could read everything with no issue, tested it and works just fine!
 
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.
 
I'll come back and explain later since I'm at work but here is the skript:

Code:
command /pick:
  description: Gives the user a diamond pick that counts blocks mined
  trigger:
    give player 1 diamond pickaxe with no nbt named "&bDiamond Pickaxe" with lore " ", "&7Blocks Mined: &e0", and "&7Ores Mined: &a0"
    set {blocksmined::%player%} to 0
    set {oresmined::%player%} to 0


on item damage:
  if name of player's tool is "&bDiamond Pickaxe":
    cancel event

on mine:
  if name of player's tool is "&bDiamond Pickaxe":
    add 1 to {blocksmined::%player%}
    if event-block is ore:
      add 1 to {oresmined::%player%}
    set lore of player's tool to " ", "&7Blocks Mined: &e%{blocksmined::%player%}%", and "&7Ores Mined: &a%{oresmined::%player%}%"

I think it's pretty self explanatory

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:
on mine:
  if tool of player is a pickaxe:
    add 1 to {blocksmined::%player%}
    set line 1 of lore of player's tool to "&7Blocks Mined: &e%{blocksmined::%player%}%"
 
Status
Not open for further replies.