Cancel SpawnerSpawnEvent based on the player who owns ASkyBlock island

Discussion in 'Plugin Development' started by firefall, Mar 29, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    firefall

    Hi, I was developing a plugin that would only let you kill a mob if you were on the correct level for a SkyBlock server. I came across a problem for SilkSpawners (and spawners in general), and that is if a mob spawns from a spawner and is used in a mob-grinder/farm, which means a player didn't kill it, lava/fall damage did.
    My solution is to cancel the spawn event until the player who owns the island is on the correct level.

    How would I go about cancelling this event? I would either need to know if the entity spawned is on the player's island, or if the spawner belongs to the player, otherwise I risk cancelling the spawn event for all players in SkyBlock regardless of level.

    As far as I know, both the SilkSpawners and ASkyBlock APIs don't have anything related to who owns a block or entity.

    Thanks for the help!
     
  2. Offline

    NukerFall

    Does ASkyBlock create spawners from default? If not, use placeevent and make block metadata "owner" to players uuid and block spawn event for spawner with that uuid
     
Thread Status:
Not open for further replies.

Share This Page