[SPIGOT-1014] Get spawner in CreatureSpawnEvent Created: 01/Jul/15 Updated: 07/Jun/16 Resolved: 07/Jun/16 |
|
Status: | Closed |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature | Priority: | Minor |
Reporter: | Faris Rehman | Assignee: | Unassigned |
Resolution: | Invalid | Votes: | 1 |
Labels: | 1.8, entity, event, spawner, spigot |
Description |
Currently, the only way of getting the spawner causing the CreatureSpawnEvent is by looping through nearby blocks and checking if it's a spawner. This is: I request that a method is made in CreatureSpawnEvent named for example, getBlock() which returns null by default but if the spawn cause is due to a spawner, it returns the spawner block. |
Comments |
Comment by Faris Rehman [ 21/Jul/15 ] |
Never knew that existed, thanks! |
Comment by Julian v.d Berkmortel [ 21/Jul/15 ] |
You can use the SpawnerSpawnEvent for this. |