#EntityTypes nms
1 messages · Page 1 of 1 (latest)
hey
are you trying to get the nms EntityTypes that corresponds to a pig?
and spawn a pig from it?
yes
ah ok I don't think you can ever infer from the Bukkit class directly
i have tried with setTarget or vectors but setTarget didn't work and vectors were very ugly
The way I have done it in the past is using this method EntityType.byString(String)
it may be called differently in your version of nms
byString doesn't exist
there might be a method that takes in a String and returns an Optional<EntityType<?>>
that will be the method I am referring to
hmm
static method
after EntittyType there only appears method about entities
or this few
maybe fromName?
if u want to spawn a pig using nms can't u just use
new EntityPig(EntityTypes.PIG, world).spawnIn(world);
still u can do that
u don't have to
just make a custom class
that extends EntityPig (that's how I normally make custom entities in NMS)
i have it already
that's not what I m talking about tho
wdym
does getHandle() give you EntityTypes or EntityPig instance
To check, you want to spawn a pig via NMS basically?
well, yes
I might have a snippet that can help you then
I use reflection though, rather than the more direct way you do, so you'll have to do a bit of converting 😄
For how I figured it out, if you need to too, is by decompiling the spigot jar using jd-gui, and looking at it's source
Also deobfuscating the Mojang jar using https://github.com/HeartPattern/MC-Remapper, and then again decompiling with jdgui and then finding the obfuscated names with https://minidigger.github.io/MiniMappingViewer/#/mojang
https://imgur.com/a/ZNdr1U7
this is what I mean
but that's assuming that u r controlling the mob using nms
u figured out the issue? if yes that's gr8
but then, in ((CraftEntity) ) he uses event.getEntity because he doesn't mind the entity who is getting, i want a pig
um, ye idk if I can help u with something I haven't watched (I thought I could so I came but that video is different then others)