Solved Get numbers from NBT

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

    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.

KmanPlayzYT

Member
Sep 29, 2017
3
0
0
Code:
Code:
on mine:
  if player is holding any pickaxe:
    if block is coal ore:
      set {_energy} to tag "chargable;energy" of nbt of player's tool
      set {_energy} to rounded {_energy}
      make {_energy} a number
      add 20 to {_energy}
      add "{chargable: {energy: {_energy}}}" to nbt of player's tool

Im trying to make a way to raise the "energy" based on NBT tags everytime someone break a coal ore.

Im thinking the NBT is getting pulled as text rather than the number

Im using SkBee
 
code_language.skript:
set {_energy} to {_energy} parsed as number

# if that ^ doesn't work, try doing

set {_energy} to "%{_energy}%" parsed as number
 
code_language.skript:
set {_energy} to {_energy} parsed as number

# if that ^ doesn't work, try doing

set {_energy} to "%{_energy}%" parsed as number
I LOVE YOU!!!! sorry if i came on too quick but ive been trying all day and this worked! TYSM
 
Status
Not open for further replies.