Config file ItemStack and Boolean

Budx

Feedback score
0
Posts
33
Reactions
1
Resources
0
Hello,

In my plugin I have a configuration file which has Itemstack.
I want to add a boolean in this file in each item. If it's true, I can give the item, if it's false, don't give it...
But the problem is that when I put the boolean in the lines of the item, the plugin sends me false all the time or else a nullPointer...
I tried a boolean outside the itemstacks of the file, and it works correctly...

How can I get this boolean for each item please?

1686000451302.png


On line 3, it returns true.
But on line 8 and 12, it returns false...

Thank you a lot !
 
Type
Requesting
Provided by
Individual

X1XX

Feedback score
0
Posts
37
Reactions
5
Resources
0
The reason it doesn't work is it appears that you are serializing your ItemStack directly into your yml file, indicated by the common ==: line. I assume it throws null pointers because when you deserialize the ItemStack, it doesn't expect there to be an extra value there.
 

Budx

Feedback score
0
Posts
33
Reactions
1
Resources
0
The reason it doesn't work is it appears that you are serializing your ItemStack directly into your yml file, indicated by the common ==: line. I assume it throws null pointers because when you deserialize the ItemStack, it doesn't expect there to be an extra value there.
Do you have a issue to help me so ?

Could you please show the source code that gave you this issue? That way we can see what exactly may cause your issue.
I tried a different method to find true when seeing messages in the console.
Post automatically merged:

1686029326452.png
 

Attachments

  • 1686029135972.png
    1686029135972.png
    312 bytes · Views: 6

Budx

Feedback score
0
Posts
33
Reactions
1
Resources
0
Last edited:
Top