Java / Minecraft: NullPointerException?

Einen wunderschönen guten Abend,

ich bekomme in meinem Spigot-Plugin eine NullPointerException.

Code:

@EventHandler
public void onClickInventory(InventoryClickEvent e) {
  if (e.getClickedInventory() != null && e.getCurrentItem() != null) {
    if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§6Gadgets")) {
      e.setCancelled(true);
    }
    else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§dKits")) {
      e.setCancelled(true);
    }
    else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§cEinstellungen")) {
      e.setCancelled(true);
    }
    else if (e.getCurrentItem().getItemMeta().getDisplayName().equals("§aFreunde")) {
      e.setCancelled(true);
    }
  }
}

Fehler:

[21:03:08 ERROR]: Could not pass event InventoryClickEvent to SkyBeastDE v0.1
org.bukkit.event.EventException
net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-db6de12-18fbb24]
        at java.base/java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.NullPointerException
        at de.skybeast.listeners.SpawnMove_EVENT.onClickInventory(SpawnMove_EVENT.java:70) ~[?:?]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        ... 15 more

Danke im Voraus!

PC, Computer, Event, Java, Programmierung, Minecraft, Programmiersprache, Minecraft plugin
4 Antworten
Spieler hat mit PermissionsEX keine Rechte, obwohl sie eindeutig gegeben sind.?

permissions,yml:

groups:

 Spieler:

  options:

   default: 'true'

   prefix: '&7[Spieler]'

   rank: '5'

  permissions:

  - essentials.warp

  - essentials.spawn

  - essentials.balancetop

  - essentials.balance.others

  - essentials.balance

  - essentials.pay

  - essentials.back.ondeath

  - essentials.back

  - essentials.msg

  - modifyworld.blocks.interact.

  - modifyworld.blocks.place.

  - modifyworld.blocks.destroy.

  - essentials.warps.

  - modifyworld.items..

  - modifyworld.damage.take.

  - modifyworld.damage.deal.

  - modifyworld.items.

  - modifyworld.sneak

  - modifyworld.sprint

  - modifyworld.chat

  - essentials.kit.Spieler

  - plots.permpack.basicflags

  - plots.permpack.basic

  - plots.plot.2

  - plots.use

  - lockette.

  - bukkit.command.help

  - modifyworld.mobtarget.creeper

  - minecraft.command.me

  - minecraft.command.list

 Pro:

  options:

   prefix: '&6[Pro]'

   inheritance: Spieler

   rank: '4'

  permissions:

  - plots.plot.3

  - -modifyworld.mobtarget.creeper

 VIP:

  options:

   inheritance: Pro

   rank: '3'

   prefix: '&e[VIP]'

  permissions:

  - plots.plot.4

  - minecraft.command.seed

 Moderator:

  permissions:

  - minecraft.command.say

  - minecraft.command.tp

  - minecraft.command.kick

  - minecraft.command.enchant

  - minecraft.command.debug

  - minecraft.command.clear

  - minecraft.command.banlist

  - minecraft.command.ban-ip

  - minecraft.command.ban

  options:

   inheritance: VIP

   rank: '2'

   prefix: '&3[Mod]'

 Admin:

  permissions:

  - ''

  options:

   prefix: '&4[Admin] '

   inheritance: SuperMod

 Developer:

  permissions:

  - ''

  options:

   prefix: '&9[Dev] '

   rank: '0'

 Owner:

  permissions:

  - ''

  options:

   prefix: '&4[Owner] '

   rank: '0'

 SuperMod:

  options:

   inheritance: Moderator

   rank: '1'

   rank-ladder: ''

   prefix: '&c[SuperMod]'

  permissions:

  - minecraft.command.kill

  - minecraft.command.pardon-ip

  - minecraft.command.pardon

 Tester:

  options:

   prefix: '&5&l[Tester] '

   inheritance: Spieler

 Builder:

  options:

   prefix: '&4[Builder] '

   inheritance: Moderator

   rank: '3'

  permissions:

  - essentials.gamemode.spectator

  - essentials.gamemode.survival

  - essentials.gamemode.creative

  - essentials.gamemode

  - essentials.gm

  - bukkit.commands.gamemode

  - spion.fly.

schema-version: 1

users:

00002i19038:

  permissions:

  - ''

  options:

   name: 1

   group: Developer

  group:

  - Developer

0000000000086:

  permissions:

  - ''

  options:

   name: 2

  group:

  - Owner

90889787677:

  permissions:

  - spion.fly.

  options:

   name: 3

  group:

  - Tester

  - Spieler

 465664564856728650:

  options:

   name: Spieler bei dem es nicht funktioniert

  group:

  - Builder

Server, Minecraft, Minecraft Server, Plug-in, Minecraft plugin, PermissionsEX, Funktioniert nicht
3 Antworten
PermissionEX Eroor die yml ist leer?

Hallo, ich habe das Permission Plugin PermissionEX auf meinem Server habe die Permissions.yml editiert und alle Ränge eingerichtet als ich dann aber den Server neu gestartet habe und jemand einen eingerichteten Rang geben wollte kam die Meldung in der Console das die Permissions.yml leer ist obwohl alle reloadet und restartet war. Sowie die Ränge in der yml eingetragen. An was liegt es?

Meine YML:

groups:
 Spieler:
  default: true
  prefix: '&7[&7Spieler]&7 '
  build: true
  permissions:
  - rank.spieler
 Premium:
  default: false
  prefix: '&6[&6Premium]&6 '
  build: true
  permissions:
  - rank.premium
 Ultra:
  default: false
  prefix: '&b[&bUltra]&b '
  build: true
  permissions:
  - rank.ultra
 Uebschi:
  default: false
  prefix: '&d[&dÜbschi]&d '
  build: true
  permissions:
  - rank.uebschi
 JrBuilder:
  default: false
  prefix: '&e[&eJrBuilder]&e '
  build: true
  permissions:
  - rank.jrbuilder
 Builder:
  default: false
  prefix: '&e[&eBuilder]&e '
  build: true
  permissions:
  - rank.builder
 SrBuilder:
  default: false
  prefix: '&e[&7SrBuilder]&7e'
  build: true
  permissions:
  - rank.srbuilder
 JrSupporter:
  default: false
  prefix: '&a[&aJrSupport]&a '
  build: true
  permissions:
  - rank.jrsup
 Supporter:
  default: false
  prefix: '&a[&aSupport]&a '
  build: true
  permissions:
  - rank.sup
 SrSupporter:
  default: false
  prefix: '&a[&aSrSupport]&a '
  build: true
  permissions:
  - rank.srsup
 JrDeveloper:
  default: false
  prefix: '&2[&2JrDev]&2'
  build: true
  permissions:
  - rank.jrdev
 Developer:
  default: false
  prefix: '&2[&2Dev]&2 '
  build: true
  permissions:
  - rank.dev
 SrDeveloper:
  default: false
  prefix: '&2[&2SrDev]&2 '
  build: true
  permissions:
  - rank.srdev
 JrModerator:
  default: false
  prefix: '&2[&2JrMod]&2 '
  build: true
  permissions:
  - rank.jrmod
 Moderator:
  default: false
  prefix: '&2[&2Mod]&2 '
  build: true
  permissions:
  - rank.mod
 SrModerator:
  default: false
  prefix: '&2[&2SrMod]&2 '
  build: true
  permissions:
  - rank.srmod
 Admin:
  default: false
  prefix: '&c[&cAdmin]&c '
  build: true
  permissions:
  rank.admin
 Owner:
  default: false
  prefix: '&4[&4Owner]&4 '
  build: true
  permissions:
  - '' 
  - rank.owner
users:
 AngeknabbertHD:
  group:
  - Owner
 ueberflieger05:
  group:
  - Owner
Computer, Gaming, Minecraft, Minecraft Server, Spigot, permissions, Minecraft plugin, PermissionsEX
2 Antworten
Minecraft Essentials geht nicht? Essentials Protect is in emergency mode. Check your log for errors?

das steht bei mir wenn ich den Server reloade. Ich hoffe mir kann wer helfen weil ich würde Essentials gerne verwenden. Ich habe auf meinem server die 1.8.8 Spigot Version.

Log:

[21:32:49] [Server thread/INFO]: Starting minecraft server version 1.8.8

[21:32:49] [Server thread/INFO]: Loading properties

[21:32:49] [Server thread/INFO]: Default game type: SURVIVAL

[21:32:50] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-21fe707-e1ebe52 (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT)

[21:32:53] [Server thread/INFO]: Anti X-Ray: true

[21:32:54] [Server thread/INFO]: Anti X-Ray: true

[21:32:54] [Server thread/INFO]: Engine Mode: 1

[21:32:54] [Server thread/INFO]: Hidden Blocks: [14, 15, 16, 21, 48, 49, 54, 56, 73, 74, 82, 129, 130]

[21:32:54] [Server thread/INFO]: Replace Blocks: [1, 5]

[21:32:54] [Server thread/INFO]: Cactus Growth Modifier: 100%

[21:32:54] [Server thread/INFO]: Cane Growth Modifier: 100%

[21:32:54] [Server thread/INFO]: Melon Growth Modifier: 100%

[21:32:54] [Server thread/INFO]: Mushroom Growth Modifier: 100%

[21:32:54] [Server thread/INFO]: Pumpkin Growth Modifier: 100%

[21:32:54] [Server thread/INFO]: Sapling Growth Modifier: 100%

[21:32:54] [Server thread/INFO]: Wheat Growth Modifier: 100%

[21:32:54] [Server thread/INFO]: NetherWart Growth Modifier: 100%

[21:32:54] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16

[21:32:54] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64

[21:32:54] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 8 Hopper Amount: 1

[21:33:00] [Server thread/INFO]: [Essentials] Enabling Essentials vTeamCity

[21:33:00] [Server thread/ERROR]: * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * !

[21:33:00] [Server thread/ERROR]: The installed version of Essentials is not compatible with this Minecraft version. Only 1.12.2 is supported.

[21:33:00] [Server thread/ERROR]: * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * !

[21:33:00] [Server thread/INFO]: [EssentialsProtect] Enabling EssentialsProtect vTeamCity

Minecraft, Minecraft plugin
3 Antworten
Minecraft PermissionsEx Plugin-stimmt das (s. Beschreibung)?

Das Problem ist, dass mir ein Fehlercode angezeigt wird, wenn ich diese Permissions folgendermaßen verteile (s. unten). Kann mir jemand sagen, was ich falsch gemacht habe ?

Thx jetzt schon mal ^^

groups:

 Spieler:

   prefix: '&e[Spieler] '

   options:

     default: true

   permissions:

   -minecraft.command.help

   -minecraft.command.list

   -minecraft.command.seed

   -minecraft.command.msg

   -minecraft.command.tell

 Moderator:

   prefix: '&b[Mod] '

   inheritance:

   -Spieler

   options:

     default: false

   permissions:

   -minecraft.command.enchant

   -minecraft.command.weather

   -minecraft.command.effect

   -minecraft.command.gamemode

   -minecraft.command.tp

   -minecraft.command.kick

   -minecraft.command.time

   -minecraft.command.give

   -minecraft.command.playsound

   -minecraft.command.stopsound

   -minecraft.command.particle

   -minecraft.command.replaceitem

 Admin:

   prefix: '&c[Admin] '

   inheritance:

   -Moderator

   options:

     default: false

   permissions:

   -minecraft.command.gamerule

   -minecraft.command.summon

   -minecraft.command.whitelist

   -minecraft.command.experience

   -minecraft.command.execute

   -minecraft.command.clear

   -minecraft.command.ban

   -minecraft.command.kill

   -minecraft.command.pardon

   -minecraft.command.spawnpoint

 Owner:

   prefix: '&4&l[Owner] '

   inheritance:

   -Admin

   options:

     default: false

   permissions:

   - ''

schema-version: 1

Minecraft plugin, Minecraft Plugins programmieren
1 Antwort
/god funktion programieren?

Hi, Ich beschäftige mich grad mit Plugin Programierung in Minecraft. Ich wollte eine god funktion in mein plugin einbauen. Hab dies auch gemacht hier der code:

package de.TreftCraft;
import java.util.ArrayList; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player;

public class God
  implements CommandExecutor
{
  public static ArrayList<String> god = new ArrayList();
 
  public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
  {
    Player p = (Player)sender;
    if (p.hasPermission("system.god"))
    {
      if (args.length == 0)
      {
        if (god.contains(p.getName()))
        {
          god.remove(p.getName());
          p.sendMessage("Du bist nun nicht mehr im Godmode!");
        }
        else
        {
          god.add(p.getName());
          p.sendMessage("Du bist nun im Godmode!");
        }
      }
      else {
        p.sendMessage("Benutze /God");
      }
    }
    else {
      p.sendMessage("Dazu hast du keine Rechte!");
    }
    return false;
  }
}

Und der EntityDamageListener:

package de.TreftCraft;
import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageEvent;


public class EntityDamage implements Listener {     @EventHandler     public void onDamage(EntityDamageEvent e) {         Player p = (Player) e.getEntity();         if (God.god.contains(p.getName())) {             e.setCancelled(true);         } else {             e.setCancelled(false);         }     } }


Ich hab alles in der Main.java hinzugefügt es geht auch alles aber in der Console wird dieser Fehler angezeigt:

[10:44:17 ERROR]: Could not pass event EntityDamageEvent to System v1.0
org.bukkit.event.EventException: null
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot_server.jar:git-Spigot-c3093ef-7e94e65]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot_server.jar:git-Spigot-c3093ef-7e94e65]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) [spigot_server.jar:git-Spigot-c3093ef-7e94e65]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) [spigot_server.jar:git-Spigot-c3093ef-7e94e65]
        at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callEvent(CraftEventFactory.java:93) [spigot_server.jar:git-Spigot-c3093ef-7e94e65] .......

EDIT: Ich muss mich entschuldigen das es hier so komisch angezeigt wird

Programmieren, Java, JavaScript, Minecraft, Minecraft Server, Plug-in, Minecraft plugin, plugins programmieren
2 Antworten
Minecraft plugin.yml fehler?

Hallo Leute,

wenn ich den Server starte kriege ich die Fehlmeldung raus:

Could not load 'plugins\Faction.jar' in folder 'plugins'

org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml

       at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:162) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at org.bukkit.craftbukkit.v1_11_R1.CraftServer.loadPlugins(CraftServer.java:301) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at net.minecraft.server.v1_11_R1.DedicatedServer.init(DedicatedServer.java:204) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:544) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]

Caused by: org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input length = 1

       at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:200) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at org.yaml.snakeyaml.reader.StreamReader.<init>(StreamReader.java:60) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at org.yaml.snakeyaml.Yaml.load(Yaml.java:381) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:157) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       ... 5 more

Caused by: java.nio.charset.MalformedInputException: Input length = 1

       at java.nio.charset.CoderResult.throwException(CoderResult.java:281) ~[?:1.8.0_25]

       at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339) ~[?:1.8.0_25]

       at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) ~[?:1.8.0_25]

       at java.io.InputStreamReader.read(InputStreamReader.java:184) ~[?:1.8.0_25]

       at org.yaml.snakeyaml.reader.UnicodeReader.read(UnicodeReader.java:123) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at java.io.Reader.read(Reader.java:140) ~[?:1.8.0_25]

       at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:184) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at org.yaml.snakeyaml.reader.StreamReader.<init>(StreamReader.java:60) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at org.yaml.snakeyaml.Yaml.load(Yaml.java:381) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:157) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]

       ... 5 more

Minecraft, minecraftserver, Minecraft plugin
5 Antworten

Meistgelesene Fragen zum Thema Minecraft plugin