Jump to content

SureShotM

Members
  • Posts

    104
  • Joined

  • Last visited

Everything posted by SureShotM

  1. Okay 1. the damage and durability, in forge at least since I last checked the damage(setMaxDamage() is the durability, when I say durability I'm talking about when I'm in game testing. In other words I'm using two words meaning the same thing. 2. My question would be is, why is the damage/durability not going down when the sword is being used like a vanilla iron sword? 3. Yes I know that, I didn't push my key binding code into my git hub yet, so that would be why its missing.
  2. Okay I know I have been posting here a lot recently and I want to make it clear, 1. I am not working on a big huge project that is going to be released I am just trying to relearn some things since the last time I modded was back in 1.4, 2. Eventually with the new Knowledge I gain I do plan on making a mod but not quit sure yet on what I want. Now time for my confusion, so I decided to move to tools and armor cause I've been curious on what I can do with them and so far on my own i was able to make two swords one has a enchant on crafting witch wasn't that hard to do, and the second one has a potion effect when it hits an entity witch again wasn't hard to do I even made a key binding where you can turn off the effect of the second sword. What led me to the key binding was I wanted the weapon to take different damage based if the effect was on or off, now here is where I'm confused, first I set the max damage to 10(for testing purpose) and then decided to test if that did anything without adding anything to the hit entity function, and nothing happened to the durability at first I decided to look to see if there was any posts on this and I came up with only one post explain he was working with is own material, as for me though I am working with iron as the material. So I did more testing and decided in my hit entity function to set damage to 2 when the effect was off and 5 when it was on(again testing purpose) but every time it would hit any entity instead of subtracting more durability it was only setting the new durability to 8 and 5 now this is were I'm confused why durability will not drop at all. Note: I have took out the set damage part out completely for now in the code but if you would like to see it this is the part class I am working in https://github.com/SureShotM/Moding-For-Fun/blob/master/src/main/java/com/Leo/mff/item/ItemLionsSword.java
  3. Your amazing that is exactly what I needed, now just kinda a side questing, in my lang file or at least for the message can I have the text have color and or bold and is this possible. Sorry I don't work with lang files enough.
  4. O ok never knew that was how mojang runs that, and after trying it out that way it still did not work, I will keep it as is for now and I'll continue seeing if I can figure it out. by seeing it do you mean untranslated text well I'm using seeing as a loose term I mean that I'll continue to try to get it to work and keep looking back to this form if any other solutions come up. If you mean that seeing it in chat as untranslated text no I do not mean that. I would like to note that all I am trying to do is send a chat message to on world enter/logging in
  5. O ok never knew that was how mojang runs that, and after trying it out that way it still did not work, I will keep it as is for now and I'll continue seeing if I can figure it out.
  6. Not to be a sticker here but one what is I18n supposed to be and second you need to remove the semi colon that is in between the parenthesis or it will through an error, other then that Ill give this a try and see if it helps
  7. im fairly new modder but the event handler is a PlayerLoggedOutEvent if you want it for when the player logs it should be PlayerLoggedInEvent or something like that oops I forgot to change it back when I was testing, Besides that note I just changed it back and it still doesn't work.
  8. Okay hi again, I am having another problem but this time I am trying to send a chat message to a player who joins a world with my mod in it. I have looked around and found what I thought was the solution but its not working and everything else I find explains the same thing. Code:ChatHandler public class ChatHandler { @SubscribeEvent public void onPlayerLog(PlayerEvent.PlayerLoggedOutEvent event) { event.player.addChatMessage(new ChatComponentTranslation("msg.message_ocelot.txt")); } } Code:Main Class code note just the regester @Mod.EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new DropHandler()); MinecraftForge.EVENT_BUS.register(new ChatHandler()); LogHelper.info("Init Complete!"); } Code: en_US.lang #Chat Localizations msg.message_ocelot.txt=Kill ocelot for its tooth I think it might be were I'm registering it but I'm not sure Thanks in advanced ~SureShotM/Leo~
  9. Thank you Thank you Thank you that was exactly what i needed. Here is that updated code for the drops only and something I want to post for future readers. EntityItem dropItem = event.entityLiving.dropItem(ModItems.lionsTooth, 1 * event.lootingLevel + r.nextInt(5)); The above code works perfectly. EntityItem dropItem = event.entityLiving.dropItem(ModItems.lionsTooth, r.nextInt(5)* event.lootingLevel + 1 ); The above code will only read event.lootingLevel + 1 EntityItem dropItem = event.entityLiving.dropItem(ModItems.lionsTooth, r.nextInt(5 * event.lootingLevel + 1)) The above code will crash the game don't know fully why but it does Thanks again for all the help ~SureShotM/Leo~
  10. Okay so I guess my question would be on how to go by doing that, I have already tried to think of a way to do that but have come up blank, my first initial thought was something like this. [embed=425,349] if(LivingDropsEvent.lootingLevel == 1//not sure what to put here actualy) { //do previous code with different drop value } [/embed] I guess I am not looking in the right place to call the lootingLevel field because its not showing up anywhere for me. Thanks again for the help I apologize for my confusion. ~SureShotM/Leo~
  11. Before I start I would like to note that I am a bit new to modding more specifically picked it back up, now that that is out of the way here's my question. I am currently having a mob drop my item using the LivingDropsEvent and it is working just fine but I read on how that even already applies if a sword has looting on it and drops more of the item based on that, when i go to test this it is always dropping the random amount that I have it set to in the code but never more based on, well again the looting. Code: [embed=425,349] public class dropHandler { public static double rand; public Random r = new Random(); @ForgeSubscribe public void sropHandler(LivingDropsEvent event) { if(event.entityLiving instanceof EntityOcelot) { if(!((EntityOcelot)entity).ischild)) { rand = Math.Random(); //sets drop rate to 50% if(rand < 0.5D) { //the r.nextInt sets it to drop a random number between 0-4 event.entityLiving.dropItem(ModItem.LionsTooth, r.nextInt(4)); } } } } } [/embed] all help is appreciated ~SureShotM/Leo~
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.