Hey great tutorial! it all works but I want to make it so that everyone with my mod gets a cape; and I cant seem to figure it out. Do you know how this could be done?
You need to get all the player names. This can be done when a player joins the world.
So many options. EntityJoinWorldEvent a PlayerConnectionHandler a TickHandler it's up to you.
I am trying to use a TickHandler but when I try and get an instance of EntityPlayer it says "can only iterate over an array or an instance of java.lang.Iterable" here is my TickHandlerCode
I am trying to use a TickHandler but when I try and get an instance of EntityPlayer it says "can only iterate over an array or an instance of java.lang.Iterable" here is my TickHandlerCode
I figured it out using a Connection Handler "Sorry about my dumb questions Darkhax", so here is the code encase anyone else wants to know how to give all players a cape.
//Just put this under the playerLoggedIn method of your connection handler
String[] players = {netHandler.getPlayer().getEntityName()};
String capeURL = "YOURURLHERE.png";
ThreadDownloadImageData image = new ThreadDownloadImageData(capeURL, null, null);
for (String username : players) {
Minecraft.getMinecraft().renderEngine.loadTexture(new ResourceLocation("cloaks/" + username), (TextureObject) image);
}
Tutorials have been moved to a non-profit site and tutorials will be posted there frequently by several authors including pages from authors such as wuppy and PaleoCrafter. The cape tutorial has been removed and will be remade for 1.7.2. All source can now be found on GitHub. More info in main post, more info coming soon.
thanks! But every one has the normal player skin...
Edit: it also crashes the server..
Oh, forgot to test it server side I will try and find a fix
Edit: I fixed it, just make sure you register your connectionhandler in your clientproxy class, I had it in my Base mod classes load method. This cape code has to run Client side, which is why you have to use your clientproxy.
Oh, forgot to test it server side I will try and find a fix
Edit: I fixed it, just make sure you register your connectionhandler in your clientproxy class, I had it in my Base mod classes load method. This cape code has to run Client side, which is why you have to use your clientproxy.
thanks, oh and this for some reason replaces my cape (I has a custom one, not the normal one) with the normal one... But i think i get around that.
hey darkhax could you help me with making a custom rendered block i have it nearly finished but my proxy's cause me to crash i'll post the reports if i see you reply
hey darkhax could you help me with making a custom rendered block i have it nearly finished but my proxy's cause me to crash i'll post the reports if i see you reply
I would have no problem giving you some advice but you should move this to a private message or create a new topic in modification development.
Mojang has explicitly stated that mod authors are not to give capes to anyone under any circumstances. As a result I am not going to be publishing any further details on adding capes to minecraft.
I will probably make a tutorial on using proxies later. No ETA though.
You need to get all the player names. This can be done when a player joins the world.
Farewell everyone o/
What method should I use for when the player joins the world
So many options. EntityJoinWorldEvent a PlayerConnectionHandler a TickHandler it's up to you.
Farewell everyone o/
I am trying to use a TickHandler but when I try and get an instance of EntityPlayer it says "can only iterate over an array or an instance of java.lang.Iterable" here is my TickHandlerCode
do you have any ideas what I am doing wrong?
I figured it out using a Connection Handler "Sorry about my dumb questions Darkhax", so here is the code encase anyone else wants to know how to give all players a cape.
Farewell everyone o/
thanks! But every one has the normal player skin...
Edit: it also crashes the server..
E
Oh, forgot to test it server side I will try and find a fix
Edit: I fixed it, just make sure you register your connectionhandler in your clientproxy class, I had it in my Base mod classes load method. This cape code has to run Client side, which is why you have to use your clientproxy.
thanks, oh and this for some reason replaces my cape (I has a custom one, not the normal one) with the normal one... But i think i get around that.
E
Hm....
Just run an if statement like I have above.
Farewell everyone o/
I would have no problem giving you some advice but you should move this to a private message or create a new topic in modification development.
Farewell everyone o/
E
Mojang has explicitly stated that mod authors are not to give capes to anyone under any circumstances. As a result I am not going to be publishing any further details on adding capes to minecraft.
Farewell everyone o/