#Count goes negative after 128 blocks

1 messages · Page 1 of 1 (latest)

round crater
#

Ran into a odd issue but couldent find anyone elses notes. maybe im using the wrong code? after 128 blocks recorded it jumps to -127???

command /Millypickgivetome:
permission: owner.sk
trigger:
give makeMilly() to player

function millionairesLore(i: item) :: item: set {_m} to getMined({_i}) set name of {_i} to {@prefix} set line 1 of {_i}'s lore to {minidiv} set line 4 of {_i}'s lore to "&b+ Can you reach 1M?" set line 2 of {_i}'s lore to "&b+ Track your /milly stats" set line 3 of {_i}'s lore to "&b+ Super durability" set line 5 of {_i}'s lore to {minidiv} set line 6 of {_i}'s lore to "&8Mined: %{_m}%" return {_i}

on mine: if name of player's tool contains {@prefix}: if isMillyblock(type of event-block) is true: add 1 to {Millyblocksmined::%player%} set {_i} to player's tool set {_m} to getMined({_i}) + 1 set {_i} to setMined({_i}, {_m}) set {_i} to millionairesLore({_i}) set player's tool to {_i} message "&8Mined: %{_m}%" to player

neon hemlock
#

Are you using NBT to store the mined block value?

round crater
#

All values check to make sure user item matches the Name of the tool< the data is stored on the tool

neon hemlock
#

So you're saying you do use NBT

#

Can you send the getMined function

round crater
# neon hemlock Can you send the getMined function

Here is the code that calls it,

function millionairesLore(i: item) :: item:
set {_m} to** getMined**({_i})
set name of {_i} to {@prefix}
set line 1 of {_i}'s lore to {minidiv}
set line 4 of {_i}'s lore to "&b+ Can you reach 1M?"
set line 2 of {_i}'s lore to "&b+ Track your /milly stats"
set line 3 of {_i}'s lore to "&b+ Super durability"
set line 5 of {_i}'s lore to {minidiv}
set line 6 of {_i}'s lore to "&8Mined: %{_m}%"
return {_i}

function makeMilly() :: item:
set {_i} to netherite pickaxe of efficiency 5 and silk touch 1 and unbreaking 10 and mending 1 with attributes flag hidden
set {_i} to setMined({_i}, 0)
set {_i} to millionairesLore({_i})
return {_i}

on mine:
if name of player's tool contains {@prefix}:
if isMillyblock(type of event-block) is true:
add 1 to {Millyblocksmined::%player%}
set {_i} to player's tool
set {_m} to getMined({_i}) + 1
set {_i} to setMined({_i}, {_m})
set {_i} to millionairesLore({_i})
set player's tool to {_i}
message "&8Mined: %{_m}%" to player
on log out:
if name of player's tool contains {@prefix}:
set {_m} to getMined(player's tool)
set {MillyGlobalblocksmined::%player%} to {_m}
#updateMillionHolo()

neon hemlock
#

No no no
I don't care about what calls it

#

I want to see the function itself

round crater
#

Sorry

function getMined(i: item) :: number:
set {_l} to getItemNBTTag({_i}, "mined")
return {_l}

neon hemlock
#

Because I'm pretty sure you're using NBT and not using an int or long tag, so you're limited to the range of a byte

#

Ok yeah send getitemnbttag too

round crater
#

function getItemNBTTag(i:item,tag:string) :: object:
set {_nbt} to nbt compound of {_i}
return (tag "tag;%{_tag}%" of {_nbt})

neon hemlock
#

Ok perfect
Try long tag "tag;... instead

#

Although it seems like your skbee may be a little outdated

round crater
#

yah its old XD

neon hemlock
#

You have a function you use for all types of tag right

#

I assume you only have 1 set tag function too?

round crater
#

yah

neon hemlock
#

You're going to need at least two types of setting in that function, or two functions

#

Because you need to be able to specify that you want to set a int tag or a long tag

round crater
#

You are the King! haha, That workd. "facepalm" i was litteraly reading that doc and compltly skimmed over it. Thank you! I will work on the other stuff aswell 🙂