[SPIGOT-5731] PortalCreateEvent#getEntity returns null for nether portals ignited by flint and steel Created: 09/May/20 Updated: 27/Jul/24 Resolved: 27/Jul/24 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Maxim Chernykh | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | 1.15.2, Portal, api, event, problem, spigot | ||
Environment: |
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 |
Issue Links: |
|
||||||||
Version: | git-Spigot-2f5d615-d07a78b (MC: 1.15.2) | ||||||||
Guidelines Read: | Yes |
Description |
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); } } } |
Comments |
Comment by Vadim Sokolov [ 10/May/20 ] |
сам ты lox |
Comment by md_5 [ 10/May/20 ] |
The method is nullable. |