#Fortune and auto pickup Skript help
1 messages · Page 1 of 1 (latest)
- you don't need a condition for every level of fortune, theres an expression for that.
- you can either give
f + 1, or arandom amount between 1 and f(where f = level of fortune)
- on a similar note, theres a whole lot of repetition there. you can make that much shorter
Thank you so much!
One quick question though, what do you mean by store in block's NBT. If you don't mind.
And I'm kind of confused on the enchant thing, like what are you saying with the random amount between 1 and f. Sorry
NBT is what makes up the item, and makes it different from other items of the same itemtype.
(An item type is just the kind of item it is. So a diamond and a diamond enchanted with mending are both an itemtype of diamond)
NBT consists of tags, some common examples are the enchantments, lore, names, durability, etc. However, with skbee you can add your own custom tags to items, blocks, and entities. you could use one of those to check if a block was placed by a player
with the bonus of having it automatically deleted when a block is broken, unlike a variable
i was basically saying you have 2 options:
- always give the maximum amount a player cant get
- or have it similar to how fortune normally works and leave it up to luck
might as well leave it up to luck lol
ex, in normal minecraft, a normal pickaxe will give 1 diamond, but a fortune 3 one will give anywhere between 1 and 4. you can do it like that, or always give 4
yeah, thank you that makes a lot of sense now
on block place:
set {_blocknbt::*} to nbt tags of nbt compound of block
on block break:
if {_blocknbt::*} is set:
if player's tool is not enchanted with fortune:
set {_drops::*} to drops of block with player's tool
clear drops
give player {_drops::*}
else:
set {_drops::*} to drops of block
clear drops
give player {_drops::*}
else:
if player's tool is enchanted with fortune:
set {_drops::*} to drops of block
clear drops
give player %level of fortune% + 1 {_drops::*}
send "%{_drops::*}%"```
This is what I have now
But when I try it I get an error
you dont need the percents there.
and its level of fortune of player's tool i beleive
{_blocknbt::*} is local, so you cant use it across events either
i would juston place: set string tag "placedByAPlayer" of NBT compound of event-block to player's uuid
then you can check if there's that tag on break
on block place:
set string tag "placedByAPlayer" of compound of event-block to player's uuid
on block break:
if block has tag "placedByAPlayer":
if player's tool is not enchanted with fortune:
set {_drops::*} to drops of block with player's tool
clear drops
give player {_drops::*}
else:
set {_drops::*} to drops of block
clear drops
give player {_drops::*}
else:
if player's tool is enchanted with fortune:
set {_drops::*} to drops of block
clear drops
give player level of fortune + 1 {_drops::*}
send "%{_drops::*}%"```
This is what I have now and these are the errors. I feel really useless. lol
try (level of fortune of player's tool + 1) of {_drops::*}
if that doesnt work you can always loop (level of fortune of player's tool + 1) times
Wdym wouldnt looping it just make it do the same thing?
The first one didnt work is why I was asking
I know it has to do with the {_drops::*} part because of this
I have in the skript to send me what drops is on block mine and it just says cobblestone block but for some reason I get this error when it's set to drops but not when it's set to cobblestone block
pleaseeee
just loop that many times and give it i guess
oh ok its gonna lag a lot but ill try again
it shouldnt with the code you have..
okay ill just try lol
wait
lol
on block place:
set string tag "placedByAPlayer" of nbt compound of event-block to player's uuid
on block break:
if nbt compound of event-block has tag "placedByAPlayer":
if player's tool is not enchanted with fortune:
set {_drops::*} to drops of block with player's tool
clear drops
give player {_drops::*}
else:
set {_drops::*} to drops of block
clear drops
give player {_drops::*}
else:
if player's tool is enchanted with fortune 1:
set {_drops::*} to drops of block
clear drops
give player {_drops::*} and {_drops::*}
else if player's tool is enchanted with fortune 2:
set {_drops::*} to drops of block
clear drops
give player {_drops::*} and {_drops::*} and {_drops::*}
else if player's tool is enchanted with fortune 3:
set {_drops::*} to drops of block
clear drops
give player {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*}
else if player's tool is enchanted with fortune 4:
set {_drops::*} to drops of block
clear drops
give player {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*} and {_drops::*}
It's only giving me 2 blocks when I should be getting 4 because I have fortune 3
im going to ed because i have class in the morning, if you can help itd mean so much, thank youfor everything already though
why do you still have the multiple conditions??