Posted July 7, 201411 yr Hello MCF forums, How would i make my custom mob have a name over his head just like if i were to name a pig for example?
July 8, 201411 yr Look at the code for render player. I've found it helpful to limit the distance it can be seen as well as direct line of sight. Avoids detection through wall. Long time Bukkit & Forge Programmer Happy to try and help
July 8, 201411 yr Author @Elyon it worked thank you EDIT: How would i get it to say something when the custom entity dies? In my case i need it to say "Smith was killed by Player"
July 8, 201411 yr @Elyon it worked thank you EDIT: How would i get it to say something when the custom entity dies? In my case i need it to say "Smith was killed by Player" If it is your custom entity, you can override the onDeath() method. For general entities you can use handle the LivingDeathEvent. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
July 8, 201411 yr Author What would i use for the actual text i have never worked with text in MC Forge
July 8, 201411 yr Make a list of all the player entities in the world and use a for loop to go through them and add a message to all of them. I have something similar in my mod, and this is how I would use it in your case (put it all in the event or method of your preference): List<EntityPlayerMP> players = world.playerEntities; for (int i = 0; i < players.size(); i++) { players.get(i).addChatMessage(/* Insert Message Here */); } You could probably also do: for (EntityPlayerMP player : world.playerEntities) { player.addChatMessage(/* Insert Message Here */); } I don't know about the second method, but the first method works fine for me. -Mitchellbrine Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible. It may be freaking fucking hard though, but still possible If you create a topic on Modder Support, live by this motto: I don't want your charity, I want your information
July 8, 201411 yr Author @Mitchellbrine Ok so i was doing that but what list is it (theres four of them when i try to import it)
July 8, 201411 yr Author Oh LOL but how do i get that player that killed it? EDIT: im not good with list ok im sorry!
July 8, 201411 yr Author Yeh i found that out by looking into some entity classes now it works but it comes up with this: http://s1308.photobucket.com/user/Taco_Does_MC/media/Minecraft%20Pictures/Mods/2014-07-08_151619_zpsb3162e0c.png.html here is the method that i used for it in my EntityClass: http://pastebin.com/vqFPf0hn
July 8, 201411 yr Author Ok like i said before i never worked with chat related thing until now so i dont know how i would do that.
July 8, 201411 yr Author Thank you i actually tried that before but it didnt come up in Eclipse's sugestions box, it turns out i just misspelled it.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.