Tassu
August 1, 2018, 4:00pm
1
Hey Sponge forums! (my first post here!)
I’m pretty new to SpongeAPI, however I have couple years experience from the Spigot world. I’ve been trying to change the drop on block break, however I just can’t figure it out.
Couple things I’ve tried (after asking for help on discord):
ChangeBlockEvent.Break
: can’t change drop there
DropItemEvent.Destruct
: doesn’t trigger on block break
DropItemEvent.Pre
: doesn’t trigger on block break
SpawnEntityEvent
: doesn’t trigger on block break
I’ve already spent couple of hours trying to figure this out so any help is appreciated
Tassu
1 Like
Try just
ItemDropEvent
From there (it is gets triggered) then try upcasting it when you know it works.
If it doesnt get triggered then put a issue on the spongeapi github page.
One of the great things about sponge is that you can listen for combined events and everything works fine. Another great thing is that you can report issues
Tassu
August 1, 2018, 5:47pm
3
Try just ItemDropEvent
Doesn’t trigger.
Another great thing is that you can report issues.
opened 11:46PM - 18 May 15 UTC
closed 04:28PM - 02 Aug 19 UTC
system: event
# NOTE: THIS IS WILDLY OUT OF DATE
**Event Progress Trackers:** [SpongeForge]… (https://github.com/SpongePowered/SpongeForge/issues/274) | **SpongeCommon** | [SpongeVanilla](https://github.com/SpongePowered/SpongeVanilla/issues/168)
## Progress tracker for events
**Please keep this updated Sponge devs!**
`achievement.GrantAchievementEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`achievement.GrantAchievementEvent.TargetPlayer`
Refer to SpongeForge or SpongeVanilla
`action.FishingEvent.HookEntity`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`action.FishingEvent.Start`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`action.FishingEvent.Stop`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`action.LightningEvent.Post`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`action.LightningEvent.Pre`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`action.LightningEvent.Strike`
Refer to SpongeForge or SpongeVanilla
`action.SleepingEvent.Finish`
Refer to SpongeForge or SpongeVanilla
`action.SleepingEvent.Post`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`action.SleepingEvent.Pre`
Refer to SpongeForge or SpongeVanilla
`action.SleepingEvent.Tick`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`block.ChangeBlockEvent.Break`
Refer to SpongeForge or SpongeVanilla
`block.ChangeBlockEvent.Decay`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`block.ChangeBlockEvent.Grow`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.ChangeBlockEvent.Modify`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`block.ChangeBlockEvent.Place`
Refer to SpongeForge or SpongeVanilla
`block.ChangeBlockEvent.Post`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`block.ChangeBlockEvent.Pre`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.CollideBlockEvent`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`block.CollideBlockEvent.Impact`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.InteractBlockEvent.Primary.MainHand`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.InteractBlockEvent.Primary.OffHand`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.InteractBlockEvent.Secondary.MainHand`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.InteractBlockEvent.Secondary.OffHand`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.NotifyNeighborBlockEvent`
Refer to SpongeForge or SpongeVanilla
`block.TickBlockEvent.Random`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.TickBlockEvent.Scheduled`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.tileentity.BrewingEvent.Finish`
Refer to SpongeForge or SpongeVanilla
`block.tileentity.BrewingEvent.Interrupt`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.tileentity.BrewingEvent.Start`
Refer to SpongeForge or SpongeVanilla
`block.tileentity.BrewingEvent.Tick`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.tileentity.ChangeSignEvent`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`block.tileentity.SmeltEvent.ConsumeFuel`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.tileentity.SmeltEvent.Finish`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.tileentity.SmeltEvent.Interrupt`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.tileentity.SmeltEvent.Start`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.tileentity.SmeltEvent.Tick`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`block.tileentity.TargetTileEntityEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`command.SendCommandEvent`
Refer to SpongeForge or SpongeVanilla
`command.TabCompleteEvent.Chat`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`command.TabCompleteEvent.Command`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`data.ChangeDataHolderEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`data.ChangeDataHolderEvent.ValueChange`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`economy.EconomyTransactionEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.AttackEntityEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.BreedEntityEvent.Breed`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.BreedEntityEvent.FindMate`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.ChangeEntityEquipmentEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.ChangeEntityEquipmentEvent.TargetHumanoid`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.ChangeEntityEquipmentEvent.TargetLiving`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.ChangeEntityEquipmentEvent.TargetPlayer`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.ChangeEntityExperienceEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.ChangeEntityPotionEffectEvent.Expire`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.ChangeEntityPotionEffectEvent.Gain`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.ChangeEntityPotionEffectEvent.Remove`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.CollideEntityEvent`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.CollideEntityEvent.Impact`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.ConstructEntityEvent.Post`
Refer to SpongeForge or SpongeVanilla
`entity.ConstructEntityEvent.Pre`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.DamageEntityEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.DestructEntityEvent`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.DestructEntityEvent.Death`
Refer to SpongeForge or SpongeVanilla
`entity.ExpireEntityEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.ExpireEntityEvent.TargetItem`
Refer to SpongeForge or SpongeVanilla
`entity.HarvestEntityEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.HarvestEntityEvent.TargetHumanoid`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.HarvestEntityEvent.TargetLiving`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.HarvestEntityEvent.TargetPlayer`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.HealEntityEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.IgniteEntityEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.InteractEntityEvent.Primary.MainHand`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.InteractEntityEvent.Primary.OffHand`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.InteractEntityEvent.Secondary.MainHand`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.InteractEntityEvent.Secondary.OffHand`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.LeashEntityEvent`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.MoveEntityEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.MoveEntityEvent.Teleport`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.MoveEntityEvent.Teleport.Portal`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.RideEntityEvent.Dismount`
Refer to SpongeForge or SpongeVanilla
`entity.RideEntityEvent.Mount`
Refer to SpongeForge or SpongeVanilla
`entity.SpawnEntityEvent`
Refer to SpongeForge or SpongeVanilla
`entity.SpawnEntityEvent.ChunkLoad`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.SpawnEntityEvent.Custom`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.SpawnEntityEvent.Spawner`
Refer to SpongeForge or SpongeVanilla
`entity.TameEntityEvent`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.UnleashEntityEvent`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.ai.AITaskEvent.Add`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.ai.AITaskEvent.Remove`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.explosive.DefuseExplosiveEvent.Post`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.explosive.DefuseExplosiveEvent.Pre`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.explosive.DetonateExplosiveEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.explosive.PrimeExplosiveEvent.Post`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.explosive.PrimeExplosiveEvent.Pre`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.item.ItemMergeItemEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.living.humanoid.AnimateHandEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.living.humanoid.ChangeGameModeEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.living.humanoid.ChangeGameModeEvent.TargetPlayer`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.living.humanoid.ChangeLevelEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.living.humanoid.ChangeLevelEvent.TargetPlayer`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.living.humanoid.player.KickPlayerEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.living.humanoid.player.PlayerChangeClientSettingsEvent`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`entity.living.humanoid.player.ResourcePackStatusEvent`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`entity.living.humanoid.player.RespawnPlayerEvent`
Refer to SpongeForge or SpongeVanilla
`entity.projectile.LaunchProjectileEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`game.GameReloadEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`game.state.GameAboutToStartServerEvent`
Refer to SpongeForge or SpongeVanilla
`game.state.GameConstructionEvent`
Refer to SpongeForge or SpongeVanilla
`game.state.GameInitializationEvent`
Refer to SpongeForge or SpongeVanilla
`game.state.GameLoadCompleteEvent`
Refer to SpongeForge or SpongeVanilla
`game.state.GamePostInitializationEvent`
Refer to SpongeForge or SpongeVanilla
`game.state.GamePreInitializationEvent`
Refer to SpongeForge or SpongeVanilla
`game.state.GameStartedServerEvent`
Refer to SpongeForge or SpongeVanilla
`game.state.GameStartingServerEvent`
Refer to SpongeForge or SpongeVanilla
`game.state.GameStoppedEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`game.state.GameStoppedServerEvent`
Refer to SpongeForge or SpongeVanilla
`game.state.GameStoppingEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`game.state.GameStoppingServerEvent`
Refer to SpongeForge or SpongeVanilla
`item.inventory.ChangeInventoryEvent.Equipment`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.ChangeInventoryEvent.Held`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.ChangeInventoryEvent.Pickup`
Refer to SpongeForge or SpongeVanilla
`item.inventory.ChangeInventoryEvent.Transfer`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Creative`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Double`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Drag.Primary`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Drag.Secondary`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Drop.Full`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Drop.Outside.Primary`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Drop.Outside.Secondary`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Drop.Single`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Middle`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.ClickInventoryEvent.NumberPress`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Primary`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Secondary`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Shift.Primary`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.ClickInventoryEvent.Shift.Secondary`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.DropItemEvent.Custom`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.DropItemEvent.Destruct`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.DropItemEvent.Dispense`
Refer to SpongeForge or SpongeVanilla
`item.inventory.DropItemEvent.Pre`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.InteractInventoryEvent.Close`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`item.inventory.InteractInventoryEvent.Open`
Refer to SpongeForge or SpongeVanilla
`item.inventory.InteractItemEvent.Primary.MainHand`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.InteractItemEvent.Primary.OffHand`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.InteractItemEvent.Secondary.MainHand`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.InteractItemEvent.Secondary.OffHand`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.UseItemStackEvent.Finish`
Refer to SpongeForge or SpongeVanilla
`item.inventory.UseItemStackEvent.Replace`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.UseItemStackEvent.Reset`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`item.inventory.UseItemStackEvent.Start`
Refer to SpongeForge or SpongeVanilla
`item.inventory.UseItemStackEvent.Stop`
Refer to SpongeForge or SpongeVanilla
`item.inventory.UseItemStackEvent.Tick`
Refer to SpongeForge or SpongeVanilla
`message.MessageChannelEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`message.MessageChannelEvent.Chat`
Refer to SpongeForge or SpongeVanilla
`network.BanIpEvent`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`network.ChannelRegistrationEvent.Register`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`network.ChannelRegistrationEvent.Unregister`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`network.ClientConnectionEvent.Auth`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`network.ClientConnectionEvent.Disconnect`
Refer to SpongeForge or SpongeVanilla
`network.ClientConnectionEvent.Join`
Refer to SpongeForge or SpongeVanilla
`network.ClientConnectionEvent.Login`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`network.PardonIpEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`network.rcon.RconConnectionEvent.Connect`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`network.rcon.RconConnectionEvent.Disconnect`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`network.rcon.RconConnectionEvent.Login`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`server.ClientPingServerEvent`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`server.query.QueryServerEvent.Basic`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`server.query.QueryServerEvent.Full`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`service.ChangeServiceProviderEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`statistic.ChangeStatisticEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`statistic.ChangeStatisticEvent.TargetPlayer`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`user.BanUserEvent`
- [x] Fired from **all** relevant parts of the Minecraft/Sponge code
- [x] In `bleeding` branch
`user.BanUserEvent.TargetPlayer`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`user.PardonUserEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`user.PardonUserEvent.TargetPlayer`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.ChangeWorldGameRuleEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.ChangeWorldWeatherEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.ChunkPreGenerationEvent.Cancelled`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.ChunkPreGenerationEvent.Complete`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.ChunkPreGenerationEvent.Post`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.ChunkPreGenerationEvent.Pre`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.ConstructPortalEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.ConstructWorldPropertiesEvent`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.ExplosionEvent.Detonate`
Refer to SpongeForge or SpongeVanilla
`world.ExplosionEvent.Post`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.ExplosionEvent.Pre`
Refer to SpongeForge or SpongeVanilla
`world.GenerateChunkEvent.Post`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.GenerateChunkEvent.Pre`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.LoadWorldEvent`
Refer to SpongeForge or SpongeVanilla
`world.SaveWorldEvent`
Refer to SpongeForge or SpongeVanilla
`world.SaveWorldEvent.Post`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.SaveWorldEvent.Pre`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.UnloadWorldEvent`
Refer to SpongeForge or SpongeVanilla
`world.chunk.ForcedChunkEvent`
Refer to SpongeForge or SpongeVanilla
`world.chunk.LoadChunkEvent`
Refer to SpongeForge or SpongeVanilla
`world.chunk.PopulateChunkEvent.Populate`
- [ ] Fired from **all** relevant parts of the Minecraft/Sponge code
- [ ] In `bleeding` branch
`world.chunk.PopulateChunkEvent.Post`
Refer to SpongeForge or SpongeVanilla
`world.chunk.PopulateChunkEvent.Pre`
Refer to SpongeForge or SpongeVanilla
`world.chunk.UnforcedChunkEvent`
Refer to SpongeForge or SpongeVanilla
`world.chunk.UnloadChunkEvent`
Refer to SpongeForge or SpongeVanilla
Not marked as done. Just opened this post to see if there were any workarounds.
I know its not the best idea in the world but you could listen for a BlockBreakEvent then a tick later check for all items that have been spawned near the location of the block and then change the item
This line says otherwise, I’m fairly sure that block drops are cancellable for block changes.
Regarding the code here from the implementation , you can see that item drops are captured and processed based on the block snapshot. Granted, this is an event thrown after the change block event, because we don’t actually process anything until the event has been thrown and determined to actually go through.
You can then modify the entities spawned for the event with the provided lists from the event.
DropItemEvent.Destruct is the correct event. Perhaps you are using an incorrect cause filter?
Tassu
August 5, 2018, 12:45pm
8
First off, sorry for a late response. I’ve been away for a few days.
Second, it does not trigger with this code:
as seen by this log; no DropItemEvent.Destruct is triggered.
latest.log
[15:41:40 INFO]: Tassu_ joined the game
[15:41:44 INFO] [blockdroptest]: TRIGGERED class org.spongepowered.api.event.ChangeBlockEvent$Break$Impl
[15:41:44 INFO] [blockdroptest]: *** cause
[15:41:44 INFO] [blockdroptest]: EntityPlayerMP['Tassu_'/298, l='world', x=-288.70, y=54.00, z=140.55]
[15:41:44 INFO] [blockdroptest]: com.google.common.util.concurrent.ListenableFutureTask@62b5f4f5
[15:41:44 INFO] [blockdroptest]: *** context
[15:41:44 INFO] [blockdroptest]: sponge:spawn_type: Spawn Type
[15:41:44 INFO] [blockdroptest]: -> SpongeSpawnType{id=sponge:dropped_item, name=DroppedItem}
[15:41:44 INFO] [blockdroptest]: sponge:owner: Owner
[15:41:44 INFO] [blockdroptest]: -> EntityPlayerMP['Tassu_'/298, l='world', x=-288.70, y=54.00, z=140.55]
This file has been truncated. show original
I found a solution to our problem, but I do not know how true it is.
@Listener
public final void onBreakBlock(ChangeBlockEvent.Break event) {
Objects.requireNonNull(event, "event");
event.getTransactions().forEach(transaction -> {
Location<World> blockLocation = transaction.getOriginal().getLocation().get();
Vector3i blockPosition = blockLocation.getBlockPosition();
blockLocation.getExtent().getEntities(entity -> {
Vector3i entityBlockPosition = entity.getLocation().getBlockPosition();
return entityBlockPosition.equals(blockPosition);
}).forEach(entity -> {
Location<World> entityLocation = entity.getLocation();
entity.remove();
Item itemEntity = (Item) entityLocation.createEntity(EntityTypes.ITEM);
itemEntity.offer(Keys.REPRESENTED_ITEM, ItemTypes.APPLE.getTemplate());
entityLocation.spawnEntity(itemEntity);
});
});
}
But there is one problem. That only works on 96 build. @gabizou what happens to the platform? Constantly everything breaks down…