Setting the conditional mob drop

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord
H

Hedgehog1024

Guest
Hello everyone,

I develop a modpack, and I want to make in this pack a way to obtain mob drops that doesn't require spawner but is still balanced. I came up to idea, inspired by Mob farm mod:
  1. Player makes special seeds and plant them.
  2. When crop is fully grown, player break it.
  3. If crop was broken with appropriate tool, a buffed mob spawns in place.
  4. Player slay the mob and get Magical crops mob essence.
All the recipes can be easily altered via Minetweaker; also I can make mod spawn after breaking the crop using Accidentally Circumstantial Events and set drops using Mob Properties. But here comes the problem: I can't find the way to make a mob drop essence only if it were spawned by mob crop. I need to mark such a mob in some way, and the only idea that seems comsiderable is using NBT. However, all the NBT tags impact on gameplay. If I make a mob to drop essence only if it has appropriate name or potion effect, for example, then player can just hame the mob via name tag or throw explosive potion. I can't even use NBT Attributes because Minecraft crashes when meet an unkown one.
How can I achieve my target without making my own mod, and is it even possible?
 
H

Hedgehog1024

Guest
It looks like I've found the solution. In case someone faces a similar problem:
  1. Make a special item that can't be legally obtainable;
  2. When mob crop is breaked, spawn the mob wearing this item;
  3. When mobs dies, check if special item is equiped. If so, replace drops with mob essence.
 

LordPINE

Well-Known Member
Jan 2, 2016
345
249
69
You could also give it the mob essence as armor (head, chest, leggings and boots all work), and then give it the drop chance you want. That way it will have a chance to drop the essence on death, without you seeing the difference to a normal mob (except for whatever else you may have done to it).
 
H

Hedgehog1024

Guest
LordPINE, it is not exactly what I want. With your suggestion mobs will also drop their regular drops, but I want them to drop ONLY mob essence.