Jump to content

Recommended Posts

Posted (edited)

Basically when you right click with a honey comb named "&6&lTOKEN POUCH" it gives you a random amount of tokens with all the flags currently below 1-5 and removes it from your inventory. This is what I have so far anything in brackets is what I don't know what to do.
Thanks in advance!

on right click:
    if player is holding honeycomb named "&6&lTOKEN POUCH" with lore "&e&l1 - 5 Tokens"
    give [random 1-5 of sunflower named "&6&lTOKEN" with nbt hide attributes, hide dye, hide enchants, hide potion effects, and hide unbreakable] to player
    remove 1 honeycomb named "&6&lTOKEN POUCH" with lore "&e&l1 - 5 Tokens"
    

 

Edited by NobodyYT
Thanks in advance!
  • 1 month later...
Posted
on right click:
    if player is holding honeycomb named "&6&lTOKEN POUCH" with lore "&e&l1 - 5 Tokens":
        set {_random} to random integer between 1 and 5
        give player {_random} of sunflower with all flags hidden named "&6&lTOKEN"
        remove 1 honeycomb named "&6&lTOKEN POUCH" with lore "&e&l1 - 5 Tokens" from player's inventory

What I did:

  • Fixed Indentation errors in all lines
  • Added a local variable "{_random}" and set it to a random integer from 1 and 5 in the 2nd line
  • Replaced the hidden flags with "with all flags hidden ...in the 3rd line
  • Added "from player's inventory" in the 4th line

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...