2 questions I need help with

11 views
Skip to first unread message

joellike...@gmail.com

unread,
Nov 16, 2015, 9:26:49 PM11/16/15
to Sams Teach Yourself Minecraft Mod Development in 24 Hours
These are two problems I have run into that I can't solve even through lots if experimentation and looking at Minecraft code.


I know how to write render classes but can't figure out how to display something that isn't a held item render but should display on the players. (Like adding ears or a sheath to the player model) How do I do that?

Also is there a way to change the damage of a sword while you are playing the game?(like making the damage go up when you right click)

Jimmy Koene

unread,
Nov 25, 2015, 11:01:05 AM11/25/15
to Sams Teach Yourself Minecraft Mod Development in 24 Hours
Hello,

I have never done either of those things myself, but I think I know how to do this.

If you want to render something on the player without it being a held item, why not get the player location somehow and add a certain offset to that? I don't know the exact method names for it, but I'm sure you can get the client player either through the Minecraft class or the World reference in your render (in case it doesn't actually contain the player reference which it often does).

I'm not sure if you can change the damage of the sword in game, but there are 2 options. If it isn't possible, you can simply change the metadata of the sword to give it a different damage value. If it is possible (which I'm assuming) you can change the getDamageDone method to be based on a certain value in the item which you change.

- Jimmy Koene

joellike...@gmail.com

unread,
Dec 15, 2015, 5:13:36 PM12/15/15
to Sams Teach Yourself Minecraft Mod Development in 24 Hours
How do I start the rendering? I know how to assign a render to a item but how do I refrence a render that is only rendered sometimes and isnt part of a item/entity/block?

Also when I make a sword have multiple metadatas after the first one they show the damage bar even though they arent damaged. Is there a way to stop that?

Thanks

Jimmy Koene

unread,
Dec 19, 2015, 10:20:54 AM12/19/15
to Sams Teach Yourself Minecraft Mod Development in 24 Hours
I've never written anything like this myself, but it's certainly possible to somehow make a Render which renders at the player.

You'll have to look into the code which sets the damage bar.
Reply all
Reply to author
Forward
0 new messages