Topic category: Help with Minecraft modding (Java Edition)
Mcreator Version: 2023.4.51615
Minecraft Version: 1.20.1 Forge (47.2.0)
Plugins: Nothing.
Summary:
In the multiplayer, press the button to create an item in the GUI to force it out of the server.
with this message, Internal Exception: java.lang.NullPointerException: Cannot invoke "net.minecraft.nbt.CompoundTag.getDouble(String)" because "nbt" is null
https://drive.google.com/file/d/1ehFaGWG6bbl0gZjABblDcOVFpPc80ODv/view?usp=drive_link
https://drive.google.com/file/d/1HuMNi1JmvKgwL9GSURWPZexz10pLC7vf/view?usp=drive_link
Detail:
I make economy system.
It works as follows.
1) Player (A) uses the card.
※ It is not a consumable item.
2) The GUI opens.
※ It looks like the following.
<Money : Player current money>
1000k 100k 10k
[button] [button] [button]
1k 100 10
[button] [button] [button]
3) Press [button] as many types as you want.
4) This amount will be reduced from the player's now and money items will be added.
5) Give the added money item to another player (B).
6) Player (B) uses the items received, and the money increases.
But Player(B) Problem occurs in number 3)
Player(B) press [Button] and force it out of the server, with this message
Internal Exception: java.lang.NullPointerException: Cannot invoke "net.minecraft.nbt.CompoundTag.getDouble(String)" because "nbt" is null
Player(A) has no problem.
※ Player (A) is 'Client' for 'Run Server and Client' in 'Mcreator'
Reference:
https://mcreator.net/forum/93342/item-nbt-works-single-player-crashes-c…
https://mcreator.net/forum/84102/playerpersistant-doesnt-work-servers-properly
※ I couldn't solve the problem even after referring to the two posts.
※ Please let me know if you need photos in your feedback. I will post all the photos you need.
Does this happen on multiplayer servers, or on LAN worlds only?
Oh..Thank you for your response!
I just checked it out, Both a multiplayer server and a LAN server happen.
Is the 'PLAYER_PERSISTANT' global variable the cause?
That is very interesting (not in a good way). Would it be possible to isolate this problem to the minimal example workspace demonstrating this bug?
Oh, I am using a translator because I am not good at English.
Do you mean to create an example workspace that generates bugs?
I make mini test workspace and attach here.
https://drive.google.com/file/d/1wZlOCamhUf6hZS4i1gMKOXWnnPd37zbp/view?…
This is probably a similar bug: https://github.com/MCreator/MCreator/issues/4288
Right now we suspect there may be some API related bug for this to happen, but we will keep on investigating
Thank you Klemen for response.
I hope there are good results. :)
I will find a version that works well in the snapshot version and upload it. I don't know if it will help... :)
Oh, never mind, I think I'm mistaken. I'll close the post again.