PortalCreateEvent#getEntity returns null for nether portals ignited by flint and steel

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Minor
    • None
    • Affects Version/s: None
    • This server is running CraftBukkit version 4226-Spigot-146439e-2889b3a (MC: 1.21) (Implementing API version 1.21-R0.1-SNAPSHOT)
    • My own plugin
    • Yes

      What behaviour is expected:

      e.getEntity() of PortalCreateEvent is equal to the player who activates the portal

      What behaviour is observed:

      It returns null. Tried the same plugin, no changes, in a paper server, worked flawlessly

      Steps/models to reproduce:

      Try this code:
      import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;

      import org.bukkit.event.world.PortalCreateEvent;

      public class NoPortals implements Listener {

      @EventHandler

      public void onPortalIgnition(PortalCreateEvent e)

      { System.out.println(e.getEntity()); // I added some fancy text to display it in chat, nothing that should change the behaviour // entity is null everywhere else //Bukkit.getServer().broadcastMessage(ChatColor.translateAlternateColorCodes('&',"&c&lSERVER&r: " + e.getEntity() + " " + e.getReason())); // }

      }
       
      And activate the nether portal.

      Plugin list:

      None, except the one with this event.

            Assignee:
            Unassigned
            Reporter:
            Cow
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: