Problems adding items to creeper loot table

Started by Irids on

Topic category: Help with modding (Java Edition)

Last seen on 01:22, 14. Nov 2021
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Problems adding items to creeper loot table

I've seen other threads with similar issues, but none of them were really answered or don't fit my specific issue. I'm trying to add music discs to the game, specifically as loot that creepers can drop when killed by skeletons like vanilla discs. Using normal loot tables doesn't seem possible as far as I'm aware, since the only loot table for creepers that's accessible is the one for kills via player that drops gunpowder, so I am using procedures as an alternative. I am not very experienced in what is and is not possible with them, so this may be simple to solve. I have made it so my custom disc spawns at a random configurable chance (I'd like it to fit in with the odds of the vanilla discs, but I cannot figure out their values or how to do that) and works as intended in regards to being spawned from death by skeleton. The issue is that, since vanilla discs are a guaranteed drop, whenever my custom disc also has the correct odds to spawn there will be two discs instead of just one. I cannot figure out a way to replace the vanilla disc when mine is set to spawn, nor can I figure out a way to simply add it to that specific loot table. Sorry if I worded anything poorly (I am willing to elaborate), it is very late and I am not experienced at all in modding. If anyone has any ideas or can help it would be much appreciated.

tl;dr
i want creepers to drop my custom discs (without affecting the vanilla ones that already exist) when killed by skeletons
i cant edit that loot table to just add more discs, and my weird method doesn't really work either, so i am out of ideas

Last seen on 08:35, 19. Nov 2023
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i guess you could kill the…
Tue, 11/30/2021 - 07:14

i guess you could kill the closest item near the creeper when it dies (the disc) and then spawn the custom one

heres the command: kill @e[type=item, sort=nearest, limit=1]