/u/Jolo_Janssen
Guest
Member
Hello everyone, this week I decided that I want to graduate from minecraft datapacks into minecraft plugins. I have watched some videos on it and I can fairly well understand the whole connection to minecraft part, because a lot is similar to datapacks. I just struggle with the "formalities" of java. I am decent at figuring stuff out myself, but I can only find old threads on my issue, which no longer work.
I am currently experimenting with custom items that do "stuff". I got a stick that summons a mob when you right click with it, but now I want to make it so it doesn't work for any stick, but special sticks (think name, lore, custom tag (if thats possible?).
The issue is I get is this error:
I use this code
submitted by /u/Jolo_Janssen
[link] [comments]
Continue reading...
free plugins
minecraft paid for free
spigotmc
SpigotMC
free minecraft paid plugins
free minecraft plugins
aac free
ewg free
Minecraft Premium Plugins
ewg free download
litebans free
epicworldgenerator free
free schematics
leaked schematics minecraft
schematics
schematics leaked
schematics free
minecraft schematics free
paid minecraft schematics free
paid minecraft schematics for free
free cracked plugins
free cracked minecraft plugins
plugins
featherboard download
featherboard plugin download
antiaura download
minecraft plugins
xenforo leaked
xenforo for free
xenforo addons
I am currently experimenting with custom items that do "stuff". I got a stick that summons a mob when you right click with it, but now I want to make it so it doesn't work for any stick, but special sticks (think name, lore, custom tag (if thats possible?).
The issue is I get is this error:
cannot invoke "org.bukkit.inventory.ItemStack.equals(Objects)" because the return value of "org.bukkit.event.player.PlayerInteractEvent.getItem()" is null
I use this code
@EventHandler public void onPlayerRightClick(PlayerInteractEvent event) { Player player = event.getPlayer(); Location spawnloc = player.getLocation(); World world = player.getWorld(); ItemStack powerstick = new ItemStack(Material.STICK); ItemMeta meta = powerstick.getItemMeta(); meta.setDisplayName("Power Stick"); powerstick.setItemMeta(meta); if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) { if(player.getInventory().getItemInMainHand().getType() == Material.STICK && player.getItemInUse().getItemMeta().getDisplayName().equals("Power Stick")) { Spider spider = (Spider) world.spawnEntity(spawnloc, EntityType.SPIDER); Bukkit.getLogger().info("Right_clicked"); } } }
submitted by /u/Jolo_Janssen
[link] [comments]
Continue reading...
free plugins
minecraft paid for free
spigotmc
SpigotMC
free minecraft paid plugins
free minecraft plugins
aac free
ewg free
Minecraft Premium Plugins
ewg free download
litebans free
epicworldgenerator free
free schematics
leaked schematics minecraft
schematics
schematics leaked
schematics free
minecraft schematics free
paid minecraft schematics free
paid minecraft schematics for free
free cracked plugins
free cracked minecraft plugins
plugins
featherboard download
featherboard plugin download
antiaura download
minecraft plugins
xenforo leaked
xenforo for free
xenforo addons