Hey there!
I am having trouble with getting the chestplate slot to behave similarly to a regular slot when using "cursor slot" expressions.
code snippet:
Right now, golden carrots disappear and energy is added properly only if I drop the carrots onto the chestplate while it is in a regular slot. If the chestplate is in the armor slot, nothing happens. If I click the chestplate itself (without carrots) both will properly send the "divine /2 /3" messages, but nothing else happens with the equipped slot. I can change the lore of the chestplate if it is not in the chestplate-slot, or specifically affect the chestplate slot by replacing "slot {_slot} of player" with "player's chestplate". However I cannot make it respond the same way to both instances regardless where the player has the chestplate (equipped or just in their inventory). Am i missing something?
Using Skript and SkBee only, please do not suggest an Addon
I am having trouble with getting the chestplate slot to behave similarly to a regular slot when using "cursor slot" expressions.
code snippet:
Code:
on inventory click:
if index of event-slot is player's chestplate: #Chestplate slot check
event-item's name = "&bLight of the &6&lDivine"
send "divine" to player
set {_divine} to 1
else if event-item is 1 of netherite chestplate: #Any other slot check (using this IF statement first causes it to read the chestplate slot, in part).
event-item's name = "&bLight of the &6&lDivine"
send "divine2" to player
set {_divine} to 1
if {_divine} = 1: #If the player clicks a chestplate with golden carrots, remove the carrots and change the chestplate's lore.
if player is alive:
set {_slot} to index of event-slot
set {_carrots} to amount of cursor slot of player
send "divine3" to player
cursor slot of player is {_carrots} of golden carrot # PROBLEM HERE???
cancel event
set cursor slot of player to air
send "%{_carrots}% carrots added" to player
add ({_carrots} * 30) to {divine::%player%} #Each GOLDEN CARROT grants 30s of energy
send "Charged %{divine::%player%}%" to player
# give player 1 of {item::LightoftheDivine} #DEBUG, gives you an upgrade in return!
set line 6 of lore of slot {_slot} of player to "&8Charge Time: &7%TimeInSeconds({divine::%player%})%"
Right now, golden carrots disappear and energy is added properly only if I drop the carrots onto the chestplate while it is in a regular slot. If the chestplate is in the armor slot, nothing happens. If I click the chestplate itself (without carrots) both will properly send the "divine /2 /3" messages, but nothing else happens with the equipped slot. I can change the lore of the chestplate if it is not in the chestplate-slot, or specifically affect the chestplate slot by replacing "slot {_slot} of player" with "player's chestplate". However I cannot make it respond the same way to both instances regardless where the player has the chestplate (equipped or just in their inventory). Am i missing something?
Using Skript and SkBee only, please do not suggest an Addon