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.
- duplicates
-
SPIGOT-5731 PortalCreateEvent#getEntity returns null for nether portals ignited by flint and steel
- Resolved