bag of loot

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

Nezerit6

Member
Mar 21, 2024
2
0
1
Hello, I want to create a loot bag (player head) with the following properties: when the player holds the bag in their hand and right-clicks, the bag will disappear from the inventory, and the player will receive loot, for example, 1 diamond. Please help, I'm using the default script without any addons. You might need a command to give the bag: "/give @p minecraft: player_head{display:{Name:'{"text":"Loot Bag","italic":false,"bold":false,"color":"gold"}',Lore:['{"text":"Contains amazing loot inside!","italic":false,"color":"yellow"}']},SkullOwner:{Id:[I;-280318807,371483529,351431569,1700428985],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGNiM2FjZGMxMWNhNzQ3YmY3MTBlNTlmNGM4ZTliM2Q5NDlmZGQzNjRjNjg2OTgzMWNhODc4ZjA3NjNkMTc4NyJ9fX0="}]}}} 1"
 
Can you give me the name of the player you're getting the head from? Otherwise I can probably just work with the ID.
Sorry, I can't give the name of the player whose head I'm using. Please try using the ID
 
Hello, I want to create a loot bag (player head) with the following properties: when the player holds the bag in their hand and right-clicks, the bag will disappear from the inventory, and the player will receive loot, for example, 1 diamond. Please help, I'm using the default script without any addons. You might need a command to give the bag: "/give @p minecraft: player_head{display:{Name:'{"text":"Loot Bag","italic":false,"bold":false,"color":"gold"}',Lore:['{"text":"Contains amazing loot inside!","italic":false,"color":"yellow"}']},SkullOwner:{Id:[I;-280318807,371483529,351431569,1700428985],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGNiM2FjZGMxMWNhNzQ3YmY3MTBlNTlmNGM4ZTliM2Q5NDlmZGQzNjRjNjg2OTgzMWNhODc4ZjA3NjNkMTc4NyJ9fX0="}]}}} 1"
The way you'd do this (I would think) is to run the give command in game then set up a command that'll save that item as a variable. Then, when the player right clicks, check if their tool is that item then run code for loot (For loot, have it so that the loot is saved in a list variable then give the player a random element from it).