September 29, 20159 yr Author Sorry had no progress yesterday, I have had some stuff happening so didn't have the time. But back to business! I still am having trouble manually doing a check to destroy my item as I damage it from an event handler as there is no onItemUse call but I can't figure out how to manually destroy the item, it just degrades to 0 then the bar starts to fade red once it gets into negative numbers. Also how do I create and store player unique values? I am wanting to create a few 'skills' and 'levels' etc for things like mining, strength, agility etc. Thanks for all your guys support, this forum has been an amazing help for me.
September 29, 20159 yr Also how do I create and store player unique values? I am wanting to create a few 'skills' and 'levels' etc for things like mining, strength, agility etc. You'll want to use [url=http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-forge-1-6-4-1-8-eventhandler-and]IExtendedEntityProperties[/url] for that. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
September 29, 20159 yr Author When the item hits 0 durability, set the item to null. will this play the destroyed sounds etc. also?
September 29, 20159 yr Author When the item hits 0 durability, set the item to null. not working, I tried doing event.entityPlayer.getHeldItem() = null; probably wrong but was the only way I thought of
September 29, 20159 yr Author still having the problem of my tools in my custom event handlers not being destroyed, but also I would like to know how to output text into the ingame chat, I thought it would be something simple but can't find anything on how to do it.
September 29, 20159 yr player.inventory.mainInventory[player.inventory.currentItem] = null; Note: This should be done on server side, so you wll have to update client by settin update boolean to true. player.addChatComponentMessage(new ChatComponentText("Message")); 1.7.10 is no longer supported by forge, you are on your own.
September 29, 20159 yr Author player.inventory.mainInventory[player.inventory.currentItem] = null; Note: This should be done on server side, so you wll have to update client by settin update boolean to true. player.addChatComponentMessage(new ChatComponentText("Message")); thanks! if I create a new function but call that function through a isRemote check is that function only run on server side then?
September 29, 20159 yr player.inventory.mainInventory[player.inventory.currentItem] = null; Note: This should be done on server side, so you wll have to update client by settin update boolean to true. player.addChatComponentMessage(new ChatComponentText("Message")); thanks! if I create a new function but call that function through a isRemote check is that function only run on server side then? No. In a way, this is what makes @SideOnly different from isRemote(). You can use isRemote() to run a part of the method on a specified side, or choose to only run it on one side (yet the method exists on both sides, unlike @SideOnly). This code has a block that is only called on the server. The method is called on both sides, but the block checks with side to execute on. public void example(World world) { System.out.println("This code is ran on both the client and the server (if the method is called that way I.E called on common)"); if(!world.isRemote) { System.out.println("This code is ran only on the server."); } } You shouldn't really need to do this - it will make your method fully server side but the method will exist on both sides public void example(World world) { if(world.isRemote) { return; } System.out.println("You will only see this code displayed through the server in the console, yet the method exists on both sides." } Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]
September 30, 20159 yr Author player.inventory.mainInventory[player.inventory.currentItem] = null; Note: This should be done on server side, so you wll have to update client by settin update boolean to true. player.addChatComponentMessage(new ChatComponentText("Message")); thanks! if I create a new function but call that function through a isRemote check is that function only run on server side then? No. In a way, this is what makes @SideOnly different from isRemote(). You can use isRemote() to run a part of the method on a specified side, or choose to only run it on one side (yet the method exists on both sides, unlike @SideOnly). This code has a block that is only called on the server. The method is called on both sides, but the block checks with side to execute on. public void example(World world) { System.out.println("This code is ran on both the client and the server (if the method is called that way I.E called on common)"); if(!world.isRemote) { System.out.println("This code is ran only on the server."); } } You shouldn't really need to do this - it will make your method fully server side but the method will exist on both sides public void example(World world) { if(world.isRemote) { return; } System.out.println("You will only see this code displayed through the server in the console, yet the method exists on both sides." } Yes I know it will also be compiled on client side but will it only RUN on server side if I do this? public void example(World world) { if(world.isRemote) { example2(); } System.out.println("You will only see this code displayed through the server in the console, yet the method exists on both sides." } public void example2() { System.out.println("This will only run on server?"); }
September 30, 20159 yr Author Really happy today, I decided to try and add a custom sound of my tools breaking, since again I have to set damage, set to null etc manually I also need to manually play a sound, so I downloaded one from a royalty free website and very first try, WORKED PERFECTLY. Really rare when that happens but when it does god its a wave of ecstasy (I really need a life). PS: should damaging tools be done server side only?
September 30, 20159 yr Congrats on that I have a supernice day today too! And for the damaging, do it on the server, it will sync to the client as far as i know.
October 1, 20159 yr Author Hey all, I am looking for a partner developer to help develop this mod obviously I can't pay as it is a home project / non-profit mod etc, however I will DEFINITELY give you all the credit you deserve even if you don't ask for it. If you want to help in any way with the live development on my mod add me on skype 'statphantom' or post here thanks.
October 2, 20159 yr Author Hey everyone, thanks for the support so far. Question does onBlockDestroyedEvent(HarvestDropsEvent event) called on every block destroyed? e.g. creeper explosions, quarry, etc? also, how hard is it to add stuff to world gen? I would like to add some fibrous plants such as Jute etc. just wondering if it is something I could do soon or if it's really hard something I should do much later.
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.