Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5731

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Java 8 build 1.8.0_251-b08

      Win10 Version 10.0.18363.778

      Spigot git-Spigot-2f5d615-d07a78b (MC: 1.15.2) - latest on 9 may 2020

    • git-Spigot-2f5d615-d07a78b (MC: 1.15.2)
    • Yes

      Event PortalCreateEvent has method .getEntity() that shoud return value like Player?

      but in this case when I create a portal (use Flint and Steel) it returns null.

      public class PreventPortal extends JavaPlugin implements Listener {
      
          @Override
          public void onEnable() {
              Bukkit.getPluginManager().registerEvents((Listener) this, (Plugin) this);
      
          }
      
          @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
          public void onPortalOpen(PortalCreateEvent event) {
              if (event.getEntity() == null) {
                  String lox = "Hello this is cant be null because im a player!";
                  getLogger().info(lox);
              }
          }
      }
      

            Unassigned Unassigned
            MiXeR54 Maxim Chernykh
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: