Background: This code has been a part of my paintball server for more than half of its existence and has never caused any problems. This code controls the consumable items in the player's inventory. To my knowledge, the code controlling the player's guns is still functional despite being structured in the same manner. After updating to Skript 2.6, the consumable items (and their amounts) in the player's inventory are not appropriately responding to changes in the variables that control their quantity in the inventory.
Expected Behavior: The items should respond to changes appropriately and update their amounts in the inventory.
Actual Behavior: The items update correctly when increasing from zero, decreasing to zero (currently at 1 but the action reduces it by 1), or when the action that decrements the variable also places a block or throws a projectile (placing a wall, bomb, throwing a grenade).
Code Errors: None, Skript parses the file and says that everything is fine.
Skript Version: 2.6
Minecraft Version (Server): 1.17.1 (git-Paper-239)
Minecraft Version (Client): 1.17.1
Code:
every tick:
loop all players:
loop-player's gamemode is survival
set {grenadeText} to "&r&lGrenade"
if {%loop-player's uuid%.gernad} is true:
set {grenadeText} to "&r&lGernad"
set {gunHandled} to false
set {sprayGunHandled} to false
set {spamGunHandled} to false
set {grenadeGunHandled} to false
set {sniperGunHandled} to false
set {railGunHandled} to false
set {swordHandled} to false
set {cobblestoneHandled} to false
set {wallHandled} to false
set {bombHandled} to false
set {grenadeHandled} to false
set {shieldHandled} to false
set {speedCompletion} to ({%loop-player's uuid%.gunSpeed}-1.0)/0.2
set {delayCompletion} to (12-{%loop-player's uuid%.gunDelayDisplay})
loop all items in loop-player's inventory:
loop-slot is not helmet
if loop-item is cobblestone:
{cobblestoneHandled} is false
set loop-item to {%loop-player's uuid%.cobblestone} of cobblestone named "&r&lIndividual Block"
set {cobblestoneHandled} to true
else if loop-item is stone:
{wallHandled} is false
set loop-item to {%loop-player's uuid%.walls} of stone named "&r&lPlacable Wall"
set {wallHandled} to true
else if loop-item is redstone block:
{bombHandled} is false
set loop-item to {%loop-player's uuid%.bombs} of redstone block named "&r&lBomb"
set {bombHandled} to true
else if loop-item is egg:
{grenadeHandled} is false
set loop-item to {%loop-player's uuid%.grenades} of egg named "%{grenadeText}%"
set {grenadeHandled} to true
else if loop-item is glass block:
{shieldHandled} is false
set loop-item to {%loop-player's uuid%.shields} of glass block named "&r&lTen-Second-Shield"
set {shieldHandled} to true
Any help is appreciated and I thank anyone who takes time in such efforts! Let me know if this is a bug that I should report to Skript.