Started by
w7n
on
Topic category: Help with Minecraft modding (Java Edition)
I've created a custom music disc, and I was wondering how you would edit a Creeper's loot table so that it also has a chance to drop music discs when killed by a skeleton. I'm assuming that the loot table of droppable music discs is somehow accessible, though I have no idea how the loot table system works in MCreator.
- thanks, w7n
You don't necessarily need a loot table to do this, but if you want the loot to be random, try binding the code below to a variable, which chooses random number, and depending on what the number is, you're mob will drop:
https://drive.google.com/file/d/18725JO6_q3JeOVnrMvVtnORPeT__4jfR/view?…
"When custom entity dies" trigger
If you want to make already existing mobs, like pigs drop custom loot, tell me!
I can dive you some code ;)
lol i cant view the file because i dont have permission
Heres the working link: https://ibb.co/T1bybBj
Bruh, I just realised that you want creepers drop music discs from skeletons...
I think it would be even better, if it would drop when killed by a ghast.
Heres the code: https://ibb.co/yQq8CmJ
Just an FYI, I want to edit the loot table of discs that the Creeper has for getting killed by a skeleton, and I don't want a creeper dropping two discs after getting killed. Is there any way to edit an existing loot table, or is it not possible?
====================================================
The command:
Do when the disk dropped execute this command: /execute at @e[distance=..3,nbt={Item:{id:"YOURE-ID:YOURE-DISK-NAME"}},limit=1] run kill @e[type=item,distance=..3,nbt={Item:{id:"minecraft:music_disc_NAME-HERE"}}]
---------------------------------------------------------------
Execute this command for every 13 disks (minecraft:music_disc_11; minecraft:music_disc_13; minecraft:music_disc_cat; ect.)
====================================================
Much mere simple command here (works almost the same):
/kill @e[type=item,distance=..3,nbt={Item:{id:"minecraft:music_disc_NAME-HERE"}}]
---------------------------------------------------------------
Execute this command for every 13 disks (minecraft:music_disc_11; minecraft:music_disc_13; minecraft:music_disc_cat; ect.)
====================================================
It should work!
Hi! So im trying to do the same, i have imported the songs and want to creepers to drop it when they get killed by a skeleton, by doing it the method you show in the screenshots i get every music disc everytime it gets killed by a skeleton, is there a way to make it random?
My procedure looks like this: https://ibb.co/znc9W1v
(Also dont pay attention to the images of the discs, they are just memes)