Minecraft / Mods

[1.10][1.11]FindTheMobs - an entity radar!

  • 6
  • 3
  • comment11
  • playlist_add
  • share
  • more_horiz
avatar Ktos94852
Level 62 : High Grandmaster Hero
129
Hi!

I'm here to present you my new mod called FindTheMobs. The idea is simple - to detect mobs (or players, of course) around you and show them on a radar. I sometimes need a simple tool like this and couldn't find any available for new versions of the game, so I made one myself.


The mod works fine with all mobs - whether they come with vanilla minecraft or not (that means mobs from other mods are detected as well).

Mod reads mobs the first time you launch the game and join any world and adds all of them to the list, where you can select specific mobs to be detected.

Radar is also customizable - you can change it's position, size, zoom, scale of icons and indicators, color, and the height difference it should notify about (when a mob's Y coord is different from yours by selected amount (default 6), an indicator will appear on the radar next to mob's icon showing whether it's above, or below you).


You can enter radar's settings by pressing R button (you can change this in settings, of course).


Mod works both in single and multiplayer mode.

Also, remember that this mod was partially a training for myself so I am not going to develop it anymore until i need to



Yes, I know that some mob icons (especially modded ones) are buggy.
Progress100% complete
Game VersionMinecraft 1.11
Tags

Comments : 11

star Login or register to post a comment.

Show Comments

1 - 11 of 11

  • Volunstein
  • Level 1
  • New Network
  • September 2, 2017, 6:55 am
Hey could you add a feature to the entity to configure them in the map with their nbt tags, like custom named armor stand ,equiped mob...
  • Tonybo
  • Level 11
  • Journeyman Architect
  • February 14, 2017, 6:28 pm
Nice. It's basically the radar feature out of most minimaps turned into a seperate mod. It's helpful for some things, otherwise I personally would use VoxelMap. But it is good, so credit!
  • MamiyaOtaru
  • Level 97
  • Overlord Programmer
  • January 29, 2017, 12:33 pm
Out of curiosity, how do you display new mobs from mods? Like what do their icons look like? That's something that's vexed me for a while
  • Ktos94852
  • Level 62
  • High Grandmaster Hero
  • January 29, 2017, 12:40 pm
Right now the icons are drawn based on first box (head) of each entity's model. Mod gets it's size, offset, draws it. This method works for mobs with simple models, but when the model gets complicated - rendered icon looks like a bunch of random pixels. I think the best way is to hook into (private) fields of entity's specific ModelRenderer so that the radar would always use the right texture offset. Going to try that as soon as I get time for that.
  • MamiyaOtaru
  • Level 97
  • Overlord Programmer
  • January 29, 2017, 1:49 pm
hah that's actually a good idea. I currently look for boxes named head, nose, ear, mouth, etc etc etc. Didn't occur to me that the head was very likely to be the first.
  • MamiyaOtaru
  • Level 97
  • Overlord Programmer
  • January 29, 2017, 2:18 pm
do note that it's not guaranteed to be true though. For example among vanilla mobs, Ocelot (7th), rabbit (8th). But I think in general you've hit upon a pretty safe assumption
  • Ktos94852
  • Level 62
  • High Grandmaster Hero
  • January 29, 2017, 8:10 pm
I thought of searching for boxes with specific names (like head), but are you sure every box actually HAS a name? I am pretty sure Minecraft skips the ModelRenderer's constructor containing the boxName field and replaces it with null. That's why I went for using the first available box.
  • MamiyaOtaru
  • Level 97
  • Overlord Programmer
  • January 30, 2017, 9:13 am
hah it's actually worse than that. I don't look for ModelRenderers whose boxName variable is set to "head" (it's more than likely null, as you point out). I look in ModelBase for ModelRenderers whose field name (in ModelBase) is head.

In ModelChicken for instance, there's a ModelRenderer named head:
public ModelRenderer head;

That of course wouldn't work once its obfuscated but it does OKish for non-vanilla mobs.

ie I'm getting instances of java.lang.reflect.Field of type ModelRenderer.class from the ModelBase.class, and checking field.getName(). It's honestly pretty gross
  • Ktos94852
  • Level 62
  • High Grandmaster Hero
  • January 30, 2017, 10:09 am
Yeah, i understand. I use reflections to get entity textures. And true, the obfuscation is annoying. But are modded mobs' fields obfuscated, too?
I know they are in vanilla Minecraft - but this is bypassable if you find obfuscated field names for each mob (what is doable for vanilla mobs) and make a simple method checking whether code is obfuscated or not. I am not sure though if modded mobs' fields get obfuscated too (I am actually kind of an amateur). If so - it seems impossible to make a mod that would find proper ModelRenderer for every found mob. Otherwise, i think it's not that hard. Just needs a while, mostly for finding these obfuscated field names.
  • MamiyaOtaru
  • Level 97
  • Overlord Programmer
  • January 30, 2017, 1:26 pm
if the ModelBase extends a vanilla type it might be obfuscated too. To catch that I check if a ModelBase instanceof ModelChicken for instance, and if so just refer to modelChicken.head directly, and after running it through the reobfuscator it works fine

For ModelBases that are their own thing, they aren't likely to be obfuscated (unless a mod author goes out of his way to do so) and searching for field names.contains("head") or whatever there works OK.

That gets pretty far, but sometimes there are models that just don't have a ModelRenderer field with head in the name. I think grabbing the first ModelRenderer like you do would fix 90 percent of those
  • Ktos94852
  • Level 62
  • High Grandmaster Hero
  • January 30, 2017, 7:44 pm
Well, looks like the best way is to combine both. Check for field with "head" in name, use it when found, otherwise use the first available ModelRenderer.

1 - 11 of 11

Show Comments

Planet Minecraft

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome