So basicly you can do /bounty put a bounty on someone with a priority; High Mid Low If the bounty player gets killed by another player they get their minecraft skull with in the lore "This bounty had a priority High/Mid/low!" Then they can go up to a npc which opens a gui where you can click on event slot 23 to give the skull and they get money and the skull gets removed. The problem is I need to make sure its the right skull and not a random one.
#Bounty skript
1 messages · Page 1 of 1 (latest)
set {_playerhead} to player head
set {_randomnumber} to random integer between 500 and 1000
remove {_playerhead} from player's inventory
add {_randomnumber} to player's balance
send "&aYou have received %{_randomnumber}% from the bounty."
else if {_prio} contains "Low":
set {_playerhead} to player head
set {_randomnumber} to random integer between 200 and 500
remove {_playerhead} from player's inventory
add {_randomnumber} to player's balance
send "&aYou have received %{_randomnumber}% from the bounty."
else if {_prio} contains "Mid":
set {_playerhead} to player head
set {_randomnumber} to random integer between 100 and 200
remove {_playerhead} from player's inventory
add {_randomnumber} to player's balance
send "&aYou have received %{_randomnumber}% from the bounty."```
This is my skript but could be changed tho
@azure canyon Sorry for the ping but I know you smart with skript since you helpt me before
I would set the bounty type in the nbt of the item, that way you don't need to check the name for that.
https://www.github.com/ShaneBeee/SkBee/wiki
To which kind of NBT should I put it too?
You can use an int tag, 1/2/3, or a string tag, high/mid/low
if attacker is a player:
if {bounty::list::*} contains victim:
remove victim from {bounty::list::*}
send "<##FD4337>&lBounty: &7The bounty of &b%victim% &7has been claimed by &b%attacker%" to all players
if {priority::%victim's uuid%} is "Low":
set {_bountypriority} to "low"
add nbt from "{tag:High}" to nbt of {_nbt}
else if {priority::%victim's uuid%} is "Mid":
set {_bountypriority} to "Mid"
add nbt from "{tag:Mid}" to nbt of {_nbt}
else if {priority::%victim's uuid%} is "High":
set {_bountypriority} to "high"
add nbt from "{tag:Low}" to nbt of {_nbt}
give attacker victim's head with name "&8&l%victim%'s head" with lore "&7&lThis bounty had a %{_bountypriority}% priority!" with nbt {_nbt}```
Idk what I did wrong
Neither do I if you dont explain further. Do you have errors? What doesnt work?
I dont have erros but like I dont think I put the nbt correctly since it doesnt work or maybe the shop doesnt work lemme send that skript as well
if player has a player head:
set {_playerhead} to player head
if (NBT compound of {_playerhead}) has NBT tag "{tag:High}":
set {_playerhead} to player head
set {_randomnumber} to random integer between 500 and 1000
remove {_playerhead} from player's inventory
add {_randomnumber} to player's balance
send "&aYou have received %{_randomnumber}% from the bounty."
if (NBT compound of {_playerhead}) has NBT tag "{tag:Mid}":
set {_playerhead} to player head
set {_randomnumber} to random integer between 200 and 500
remove {_playerhead} from player's inventory
add {_randomnumber} to player's balance
send "&aYou have received %{_randomnumber}% from the bounty."
if (NBT compound of {_playerhead}) has NBT tag "{tag:Low}":
set {_playerhead} to player head
set {_randomnumber} to random integer between 100 and 200
remove {_playerhead} from player's inventory
add {_randomnumber} to player's balance```
So like if I click on the event-slot 23 in the gui
Nothing happends
Nononono
Dont ask me to look through 200 lines, especially if i dont know what to look for
Try debugging first
Well it are just 3 copies sort of
but its about this line I think in the gui
if (NBT compound of {_playerhead}) has NBT tag "{tag:High}":
you never set {_nbt} to anything in that code
On the last line I created a player head with the nbt var
right, but that variable wasn't initially set to anything, so it can't have anything added to it
So instead of the adds I should make them set?
yeah, so something like set {_nbt} to nbt compound from "{custom;tag:High}"
you also need the custom; because this is a custom tag you are using
Is there a way to check the nbt because it aint working so I can check hwere the error is
set {_bountypriority} to "high"
set {_nbt} to nbt compound from "{custom;tag:Low}"```
Well I have this but if I later check the {_nbt} its nothing
<none>
to debug, you can just broadcast nbt compound of player's tool while holding the item
I debugged it and it and didnt have the custom nbt tag
Can we se where you apply the tag to the item?
set {_bountypriority} to "high"
set {_nbt} to nbt compound from "{custom;tag:Low}"```
set {_bountypriority} to "high"
set {_nbt} to nbt compound from "{custom;tag:Low}"
give attacker victim's head with name "&8&l%victim%'s head" with lore "&7&lThis bounty had a %{_bountypriority}% priority!" with nbt {_nbt}``` here
try setting a variable to the item, apply the nbt, then give the variable
But wouldn’t I need to give the item first and then change the nbt?
Why?
How can I otherwise set a nbt to something that doesn’t exist yet
It does exist, in the variable
Well I did something but dont know if its right
set {_bountypriority} to "low"
else if {priority::%victim's uuid%} is "Mid":
set {_bountypriority} to "Mid"
else if {priority::%victim's uuid%} is "High":
set {_bountypriority} to "high"
set {_item} to victim's head with name "&8&l%victim%'s head" with lore "&7&lThis bounty had a %{_bountypriority}% priority!"
if {priority::%victim's uuid%} is "Low":
set {_nbt} to nbt compound from "{custom;tag:High}"
else if {priority::%victim's uuid%} is "Mid":
set {_nbt} to nbt compound from "{custom;tag:Mid}"
else if {priority::%victim's uuid%} is "High":
set {_nbt} to nbt compound from "{custom;tag:Low}"
add NBT from {_nbt} to NBT compound of {_item}
give attacker {_item}```
It doesnt work but I think I could have messed up somwhere
you can set {_nbt} to nbt compound from "{custom;tag:%{_bountypriority}%}", no need for 3 if statements
capitalisation?
if attacker is a player:
if {bounty::list::*} contains victim:
remove victim from {bounty::list::*}
send "<##FD4337>&lBounty: &7The bounty of &b%victim% &7has been claimed by &b%attacker%" to all players
if {priority::%victim's uuid%} is "Low":
set {_bountypriority} to "Low"
else if {priority::%victim's uuid%} is "Mid":
set {_bountypriority} to "Mid"
else if {priority::%victim's uuid%} is "High":
set {_bountypriority} to "High"
set {_item} to victim's head with name "&8&l%victim%'s head" with lore "&7&lThis bounty had a %{_bountypriority}% priority!"
set {_nbt} to nbt compound from "{custom;tag:%{_bountypriority}%}"
add NBT from {_nbt} to NBT compound of {_item}
give attacker {_item}```
If I check the tag of the item
It doesnt have the tag that I gave it
Its just give me the skillowner the name and the lore
not the {custom;tag:%{_bountypriority}%}
try setting it manually
set string tag "example;something" of NBT compound of {_item} to "potato"
Now it does work, but know the checkign does not work
I tried this
if string tag "custom;tag" of NBT compound of {_playerhead} is "High":
its
custom:{tag:"High"}
Could this work?
if string tag "custom:{tag:""High""}" of NBT compound of {_playerhead} is "High":
I dont think it works
could have made a mistake
what did you broadcast?
the tag?
nonono, dont set it to "{stuff}"
set it to "high"
the nbt of the player head
Dont get the last two messages really
show me the line where you set the tag
its this one
oh whait no
This one
set string tag "custom;tag" of NBT compound of {_item} to "%{_bountypriority}%"
okay, now broadcast string tag "custom;tag" of NBT compound of {_item}
It is High
I have like the feeling that this should work but it doesnt
if string tag "custom;tag" of NBT compound of {_playerhead} is "High":
yeah
Could we maybe like
Loop all player heads
so then {_playerhead} doesnt have the tag
Well the playerhead does have the tag
and
It doesnt even say it has a skull owner if I look at the whole nbt
But it does
where do you set the var
if player has a player head:
set {_playerhead} to player head ```
well yeah
thats not gonna do anything
thats just an item type
not the actual item the player has
to player head in player’s inventory