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); } } }
- is duplicated by
-
SPIGOT-7851 PortalCreateEvent#getEntity returns null for nether portals ignited by flint and steel
- Resolved