[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:
1. Inefficient
2. Bad because it may produce incorrect results if 2 spawners are placed next to each other.

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.

Generated at Tue Apr 22 05:57:11 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.