Jump to content

[1.8] My First Modding Experience


statphantom

Recommended Posts

  • Replies 66
  • Created
  • Last Reply

Top Posters In This Topic

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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?");
}

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Selamat datang di OLXTOTO, situs slot gacor terpanas yang sedang booming di industri perjudian online. Jika Anda mencari pengalaman bermain yang luar biasa, maka OLXTOTO adalah tempat yang tepat untuk Anda. Dapatkan sensasi tidak biasa dengan variasi slot online terlengkap dan peluang memenangkan jackpot slot maxwin yang sering. Di sini, Anda akan merasakan keseruan yang luar biasa dalam bermain judi slot. DAFTAR OLXTOTO DISINI LOGIN OLXTOTO DISINI AKUN PRO OLXTOTO DISINI   Slot Gacor untuk Sensasi Bermain Maksimal Olahraga cepat dan seru dengan slot gacor di OLXTOTO. Rasakan sensasi bermain maksimal dengan mesin slot yang memberikan kemenangan beruntun. Temukan keberuntungan Anda di antara berbagai pilihan slot gacor yang tersedia dan rasakan kegembiraan bermain judi slot yang tak terlupakan. Situs Slot Terpercaya dengan Pilihan Terlengkap OLXTOTO adalah situs slot terpercaya yang menawarkan pilihan terlengkap dalam perjudian online. Nikmati berbagai genre dan tema slot online yang menarik, dari slot klasik hingga slot video yang inovatif. Dipercaya oleh jutaan pemain, OLXTOTO memberikan pengalaman bermain yang aman dan terjamin.   Jackpot Slot Maxwin Sering Untuk Peluang Besar Di OLXTOTO, kami tidak hanya memberikan hadiah slot biasa, tapi juga memberikan kesempatan kepada pemain untuk memenangkan jackpot slot maxwin yang sering. Dengan demikian, Anda dapat meraih keberuntungan besar dan memenangkan ribuan rupiah sebagai hadiah jackpot slot maxwin kami. Jackpot slot maxwin merupakan peluang besar bagi para pemain judi slot untuk meraih keuntungan yang lebih besar. Dalam permainan kami, Anda tidak harus terpaku pada kemenangan biasa saja. Kami hadir dengan jackpot slot maxwin yang sering, sehingga Anda memiliki peluang yang lebih besar untuk meraih kemenangan besar dengan hadiah yang menggiurkan. Dalam permainan judi slot, pengalaman bermain bukan hanya tentang keseruan dan hiburan semata. Kami memahami bahwa para pemain juga menginginkan kesempatan untuk meraih keberuntungan besar. Oleh karena itu, OLXTOTO hadir dengan jackpot slot maxwin yang sering untuk memberikan peluang besar kepada para pemain kami. Peluang Besar Menang Jackpot Slot Maxwin Peluang menang jackpot slot maxwin di OLXTOTO sangatlah besar. Anda tidak perlu khawatir tentang batasan atau pembatasan dalam meraih jackpot tersebut. Kami ingin memberikan kesempatan kepada semua pemain kami untuk merasakan sensasi menang dalam jumlah yang luar biasa. Jackpot slot maxwin kami dibuka untuk semua pemain judi slot di OLXTOTO. Anda memiliki peluang yang sama dengan pemain lainnya untuk memenangkan hadiah jackpot yang besar. Kami percaya bahwa semua orang memiliki kesempatan untuk meraih keberuntungan besar, dan itulah mengapa kami menyediakan jackpot slot maxwin yang sering untuk memenuhi harapan dan keinginan Anda.  
    • LOGIN DAN DAFTAR DISINI SEKARANG !!!! Blacktogel adalah situs judi slot online yang menjadi pilihan banyak penggemar judi slot gacor di Indonesia. Dengan platform yang sangat user-friendly dan berbagai macam permainan slot yang tersedia, Blacktogel menjadi tempat yang tepat untuk penggemar judi slot online. Dalam artikel ini, kami akan membahas tentang Blacktogel dan keunggulan situs slot gacor online yang disediakan.  
    • Situs bandar slot online Gacor dengan bonus terbesar saat ini sedang menjadi sorotan para pemain judi online. Dengan persaingan yang semakin ketat dalam industri perjudian online, pemain mencari situs yang tidak hanya menawarkan permainan slot yang gacor (sering memberikan kemenangan), tetapi juga bonus terbesar yang bisa meningkatkan peluang menang. Daftar disini : https://gesit.io/googlegopek
    • Situs bandar slot online Gacor dengan bonus terbesar saat ini sedang menjadi sorotan para pemain judi online. Dengan persaingan yang semakin ketat dalam industri perjudian online, pemain mencari situs yang tidak hanya menawarkan permainan slot yang gacor (sering memberikan kemenangan), tetapi juga bonus terbesar yang bisa meningkatkan peluang menang. Daftar disini : https://gesit.io/googlegopek
    • Situs bandar slot online Gacor dengan bonus terbesar saat ini sedang menjadi sorotan para pemain judi online. Dengan persaingan yang semakin ketat dalam industri perjudian online, pemain mencari situs yang tidak hanya menawarkan permainan slot yang gacor (sering memberikan kemenangan), tetapi juga bonus terbesar yang bisa meningkatkan peluang menang. Daftar disini : https://gesit.io/googlegopek
  • Topics

×
×
  • Create New...

Important Information

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