-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
Environment:
Tested on both Windows and Ubuntu
-
4564-Spigot-6e369ba-88f17af
-
Yes
Similar to the recent bug that was fixed with CraftConsumableComponent here, CraftConsumableApplyEffects cannot be deserialized.
It seems all effects in https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/inventory/components/consumable/effects are missing from the registration creating the following error when trying to load back the items written :
[16:54:55] [Server thread/WARN]: org.yaml.snakeyaml.error.YAMLException: Could not deserialize object [16:54:55] [Server thread/WARN]: at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:60) [16:54:55] [Server thread/WARN]: at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264) [16:54:55] [Server thread/WARN]: at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247) [16:54:55] [Server thread/WARN]: at org.yaml.snakeyaml.constructor.BaseConstructor.constructSequenceStep2(BaseConstructor.java:464) [16:54:55] [Server thread/WARN]: at org.yaml.snakeyaml.constructor.BaseConstructor.constructSequence(BaseConstructor.java:430) [16:54:55] [Server thread/WARN]: at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlSeq.construct(SafeConstructor.java:574) [16:54:55] [Server thread/WARN]: at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264) [16:54:55] [Server thread/WARN]: at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247) [16:54:55] [Server thread/WARN]: at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:576) [16:54:55] [Server thread/WARN]: at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:210) [16:54:55] [Server thread/WARN]: at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:552) [16:54:55] [Server thread/WARN]: at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:597)
[16:54:55] [Server thread/WARN]: Caused by: java.lang.IllegalArgumentException: Specified class does not exist ('org.bukkit.craftbukkit.v1_21_R6.inventory.components.consumable.effects.CraftConsumableApplyEffects')
The following item can be used for testing CraftConsumableApplyEffects :
give @a mushroom_stew[custom_name=[{"text":"Super Regular Mushroom Stew","italic":false}],lore=[[{"text":"This one is not suspicious","italic":false}]],food={nutrition:1,saturation:1},consumable={on_consume_effects:[{type:apply_effects,effects:[{id:instant_health,duration:1,amplifier:1},{id:absorption,duration:160,amplifier:1},{id:regeneration,duration:80,amplifier:2},{id:speed,duration:160,amplifier:2}]}]}]