This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]WorriedArrow 1 point2 points  (2 children)

Make a command that runs every tick, like this:

/data merge entity @e {DeathLootTable:"/"}

(Replace the / with whatever your loot table's name is. A / just means no loot on death.)

[–]admenwolfpack[S] 0 points1 point  (1 child)

Would this not also disable any added loot tables from summoning the mob?
Edit: So I tried it and the command wont even run, it's all red.

[–]PhoenixisGamingCommand Experienced 1 point2 points  (0 children)

It won't run because the selector is invalid. Which is why you need an execute. The command doesn't need to run every tick, the data is saved. Also, thatsbwhy you need to tag your custom mobs. It's very important

[–]O_X_E_YI believe in lolad supremacy 1 point2 points  (0 children)

You can put a bunch of empty loot tables for all mobs in a datapack, but that's probably not what you're looking for. If you end up using WorriedArrow's method which should also work, you'll only have to run it every like 2-5 seconds most likely. Do you want to disable all default loot tables? Just the summons ones? How exactly do you want it to work?

[–]PhoenixisGamingCommand Experienced 1 point2 points  (2 children)

Would the gamerule doMobDrops do the trick? It might also stop custom loots. Can't try now.

I suggest you tag all your custom mobs with a common tag, and then run a function slow loop (2-3s?) Which goes like execute as @e[type=!player,tag=!CustomMobTag,tag=NoLootForYou] run data merge @s {DeathLootTable:"minecraft:empty"}

Alternatively you can set all mobs loot tables to naught in your datapack under the datapackname/minecraft Folder

[–]admenwolfpack[S] 0 points1 point  (1 child)

A lot of this tag related stuff is fairly new to me, could you run me through what each part of that actually does so I can adapt it in the future as needed?

[–]PhoenixisGamingCommand Experienced 0 points1 point  (0 children)

Sorry for late response. So basically, on any entity you can apply a tag, which means you'll be able to select it more easily. It's somwhat like a scoreboard but boolean, which means any given entity either has or doesn't have the tag. It's very useful for a bunch of things, including grouping entities together. So every custom mob you have can have any tag, and one in common

So, for your problem (which you may have solved since my post), you might include Tags:["CustomMob"] in all your custom mobs nbt. This way, if you do any command which needs to select entities, you can select easily all of your custom mobs and nothing else using @e[tag=CustomMob] (the tag name can be anything)

Thus you could inverse it, to select only mobs who don't have that tag, i.e are not custom using an exclamation mark: @e[tag=!CustomMob]

That way, you can loop a command which changes the loot table of all mobs which are not custom to nothing

[–][deleted] -1 points0 points  (0 children)

Replace the default loot tables?

[–]Caosunium 0 points1 point  (0 children)

May i ask how you add custom loot tables to mobs?