question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error creating item - NullPointerException: null

See original GitHub issue

Magic dev 3522

I have a custom GUI from the plugin BossShopPro that when you interact with an item, it runs the command /mgive <name> to give the player the item. Recent dev builds of Magic seem to break this and now output an error.

[05:13:09] [Server thread/INFO]: mibby issued server command: /hats
[05:13:11] [Server thread/INFO]: Gave 1 Test Hat to mibby
[05:13:11] [Server thread/WARN]: [Magic] Error creating item: hat_test
java.lang.NullPointerException: null
	at com.elmakers.mine.bukkit.wand.Wand.doShowBoundInstructions(Wand.java:926) ~[?:?]
	at com.elmakers.mine.bukkit.wand.Wand.takeOwnership(Wand.java:1009) ~[?:?]
	at com.elmakers.mine.bukkit.wand.Wand.tryToOwn(Wand.java:899) ~[?:?]
	at com.elmakers.mine.bukkit.magic.Mage.tryGiveItem(Mage.java:3823) ~[?:?]
	at com.elmakers.mine.bukkit.magic.Mage.tryGiveItem(Mage.java:3771) ~[?:?]
	at com.elmakers.mine.bukkit.magic.Mage.giveItem(Mage.java:3746) ~[?:?]
	at com.elmakers.mine.bukkit.magic.Mage.giveItem(Mage.java:3765) ~[?:?]
	at com.elmakers.mine.bukkit.magic.command.MagicGiveCommandExecutor$1.updated(MagicGiveCommandExecutor.java:136) ~[?:?]
	at com.elmakers.mine.bukkit.magic.MagicController.createItem(MagicController.java:5832) ~[?:?]
	at com.elmakers.mine.bukkit.magic.command.MagicGiveCommandExecutor.onCommand(MagicGiveCommandExecutor.java:126) ~[?:?]
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:172) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:806) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at org.bukkit.Bukkit.dispatchCommand(Bukkit.java:758) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at org.black_ixx.bossshop.core.rewards.BSRewardTypeCommand.giveReward(BSRewardTypeCommand.java:43) ~[?:?]
	at org.black_ixx.bossshop.core.BSBuy.purchase(BSBuy.java:507) ~[?:?]
	at org.black_ixx.bossshop.core.BSBuy.purchaseTask(BSBuy.java:449) ~[?:?]
	at org.black_ixx.bossshop.core.BSBuy.purchaseTry(BSBuy.java:423) ~[?:?]
	at org.black_ixx.bossshop.core.BSBuy.click(BSBuy.java:392) ~[?:?]
	at org.black_ixx.bossshop.listeners.InventoryListener.purchase(InventoryListener.java:189) ~[?:?]
	at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor791.execute(Unknown Source) ~[?:?]
	at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:611) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:2643) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.PacketPlayInWindowClick.a(SourceFile:32) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.PacketPlayInWindowClick.a(SourceFile:10) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:43) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1220) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1213) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1189) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1029) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:176) ~[1.16.5-patched.jar:git-Yatopia-dev/threaded-worldgen-"9b84e5e"]
	at java.lang.Thread.run(Thread.java:832) [?:?]
[05:13:11] [Server thread/INFO]: Unknown item type hat_test

Edit: Magic dev 3521 works fine.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
NathanWolfcommented, Feb 9, 2021

You can do target: self to target yourself. That does sound odd though- I’ll play with it a bit in the default configs, maybe there’s some case there were targeting goes weird.

1reaction
NathanWolfcommented, Feb 8, 2021

Well some quick testing shows that something is in fact broken and probably has been for a while… players can no longer target themselves if they can’t pvp. I’ll fix that for the next dev build too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - What is a NullPointerException, and how do I fix it?
The NullPointerException (NPE) typically occurs when you declare a variable but did not create an object and assign it to the variable before...
Read more >
How to Fix and Avoid NullPointerException in Java - Rollbar
The NullPointerException occurs due to a situation in application code where an uninitialized object is attempted to be accessed or modified.
Read more >
How to resolve the java.lang.NullPointerException - Educative.io
This error can be resolved by using a try-catch block or an if-else condition to check if a reference variable is null before...
Read more >
How to deal with NullPointerException in Java with Examples
NullPointerException in Java is nothing but an error or precisely an exception that occurs if we tried to perform any operation on an...
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
1. NullPointerException when calling an instance method · 2. Java NullPointerException while accessing/modifying field of a null object · 3. Java ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found