Skip to content

NullPointerException: Cannot invoke "org.bukkit.entity.Player.getWorld()" because "this.player" is null #124

@Folas1337

Description

@Folas1337

https://mclo.gs/pMIMDqI

Using this setup:

Events:
  lootGenerateEvent1:
    type: custom
    custom_event_data:
      event: org.bukkit.event.world.LootGenerateEvent
      player_variable: getEntity()
    actions:
      default:
        - 'call_event: testCall1'
  testCall1:
    type: call
    actions:
      default:
        - 'to_range: 32;true: actionbar: Test;200'

When setting a Decorated Pot with the following command and breaking it: /setblock ~ ~ ~ decorated_pot{LootTable:"chests/end_city_treasure"} replace, potentially because the getEntity() returns null when decorated pots generate loot tables compared to chests.
The decorated pot only has a chest loot table for demonstration purposes. They usually use different loot tables.

I'm using this somewhat strange setup because it was the only way I could make an action bar appear within a range of a player.

The getEntity() method returns null for the decorated pot which it doesn't for other containers like chests, so I am assuming that's the reason but I'll leave the rest to you 🫡

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions