Jump to content

[1.14.4] Making a Trident like item


MineModder2000

Recommended Posts

Probably make it extend the class that already controls the trident.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

32 minutes ago, MineModder2000 said:

 

Yes I figured that, but then I need a parameter to put in the constructor for that (Properties builder), and I don't know which Properties to put. 

Check out what property vanilla Minecraft passed in and alter the values to your need.

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

31 minutes ago, DavidM said:

Check out what property vanilla Minecraft passed in and alter the values to your need.

Well it just gets the Properties from the Item.class, which is the start..... I had this already :

 

ItemList.spear = new Spear(new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("spear"))

 

Spear extends TridentItem, but still doesn't behave like it. I even tried making ItemList.spear a new TridentItem and that didn't work. 

Link to comment
Share on other sites

4 hours ago, MineModder2000 said:

but still doesn't behave like it.

Describe behave. Does it not throw the item? Does it not render the item when thrown. Does it not show up at all?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Show your code.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Just now, Draco18s said:

Show your code.

package mymod;

import net.minecraft.item.TridentItem;

public class Spear extends TridentItem {

	public Spear(Properties builder) {
		
		super(builder);
	}
}
package lists;

import net.minecraft.item.Item;

public class ItemList {

	public static Item spear;
}
    @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
    public static class RegistryEvents {
    	
        @SubscribeEvent
        public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
            // register a new block here
            LOGGER.info("HELLO from Register Block");
        }
        
        @SubscribeEvent
        public static void registerItems(final RegistryEvent.Register<Item> event) {
        	
        	LOGGER.info("HELLO from Register Items");
        	
        	event.getRegistry().registerAll(
        			
        		ItemList.spear = new Spear(new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("spear"))
        	);
        }
        
        private static ResourceLocation location(String name) {
        	
        	return new ResourceLocation("mymod", name);
        }
Link to comment
Share on other sites

On 8/19/2019 at 12:44 PM, MineModder2000 said:

Can't throw it basically.

How did you test this? Did you stand right in front of the entity and right click to throw it?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

You need to set the max damage when registering the item. E.g. 

new Spear(new Item.Properties().group(group).maxDamage(250).setRegistryName(name))

 

Source: net.minecraft.item.Items

If you don't, the first if statement in TridentItem#onItemRightClick will trigger and return a FAIL.

Edited by TheMikeste1
  • Thanks 1
Link to comment
Share on other sites

6 hours ago, TheMikeste1 said:

You need to set the max damage when registering the item. E.g. 


new Spear(new Item.Properties().group(group).maxDamage(250).setRegistryName(name))

 

Source: net.minecraft.item.Items

If you don't, the first if statement in TridentItem#onItemRightClick will trigger and return a FAIL.

May you be blessed with many fortunes, thanks a lot this worked!

Link to comment
Share on other sites

Though it throws like a spear / trident now, still need some help with the model side of things, I just copied the trident.jsons, but clearly I need to more, probably with code.

 

Spear

Spoiler

{
    "parent": "item/generated",
    "textures": {
    
        "layer0": "mymod:item/spear"
    }
}

Spear_Throwing

Spoiler

{
    "parent": "builtin/entity",
    "textures": {
        "mymod:item/spear"
    },
    "display": {
        "thirdperson_righthand": {
            "rotation": [ 0, 90, 180 ],
            "translation": [ 8, -17, 9 ],
            "scale": [ 1, 1, 1 ]
        },
        "thirdperson_lefthand": {
            "rotation": [ 0, 90, 180 ],
            "translation": [ 8, -17, -7 ],
            "scale": [ 1, 1, 1 ]
        },
        "firstperson_righthand": {
            "rotation": [ 0, -90, 25 ],
            "translation": [ -3, 17, 1],
            "scale": [ 1, 1, 1 ]
        },
        "firstperson_lefthand": {
            "rotation": [ 0, 90, -25 ],
            "translation": [  13, 17, 1],
            "scale": [ 1, 1, 1 ]
        },
        "gui": {
            "rotation": [ 15, -25, -5 ],
            "translation": [ 2, 3, 0 ],
            "scale": [ 0.65, 0.65, 0.65 ]
        },
        "fixed": {
            "rotation": [ 0, 180, 0 ],
            "translation": [ -2, 4, -5],
            "scale":[ 0.5, 0.5, 0.5]
        },
        "ground": {
            "rotation": [ 0, 0, 0 ],
            "translation": [ 4, 4, 2],
            "scale":[ 0.25, 0.25, 0.25]
        }
    }
}

Spear_Hand

Spoiler

{
    "parent": "builtin/entity",
    "textures": {
        "mymod:item/spear"
    },
    "display": {
        "thirdperson_righthand": {
            "rotation": [ 0, 60, 0 ],
            "translation": [ 11, 17, -2 ],
            "scale": [ 1, 1, 1 ]
        },
        "thirdperson_lefthand": {
            "rotation": [ 0, 60, 0 ],
            "translation": [ 3, 17, 12 ],
            "scale": [ 1, 1, 1 ]
        },
        "firstperson_righthand": {
            "rotation": [ 0, -90, 25 ],
            "translation": [ -3, 17, 1],
            "scale": [ 1, 1, 1 ]
        },
        "firstperson_lefthand": {
            "rotation": [ 0, 90, -25 ],
            "translation": [ 13, 17, 1],
            "scale": [ 1, 1, 1 ]
        },
        "gui": {
            "rotation": [ 15, -25, -5 ],
            "translation": [ 2, 3, 0 ],
            "scale": [ 0.65, 0.65, 0.65 ]
        },
        "fixed": {
            "rotation": [ 0, 180, 0 ],
            "translation": [ -2, 4, -5],
            "scale":[ 0.5, 0.5, 0.5]
        },
        "ground": {
            "rotation": [ 0, 0, 0 ],
            "translation": [ 4, 4, 2],
            "scale":[ 0.25, 0.25, 0.25]
        }
    },
    "overrides": [
        {
            "predicate": {
                "throwing": 1
            },
            "model": "mymod:item/spear_throwing"
        }
    ]
}

 

It doesn't hold in the hand correctly, especially when primed for throwing in which its not even in the hand but well above. When I toss it, it turns into trident. 

Edited by MineModder2000
Link to comment
Share on other sites

I'm not very familiar with Renderers, so it's probably best to get someone else's input.

If you dig around in Minecraft's files (as it seems you've done a couple posts prior), you'll notice there's a model/trident.json and a model/trident_in_hand.json. I assume  "in_hand" is the one representing the item you hold. You'll notice the parent is builtin/entity, which means it is using a registered Entity as a model. This means you'll need to create and register an Entity to serve as the model of your Item, as well as hold other important information. If you want to see vanilla example of creating Entities, check Minecraft's EntityType (You want to do this. There a a couple things I'm leaving out, such as defining hitboxes).

With Forge you register an Entity (or rather, an EntityType) a little differently than vanilla. It's basically the same as other Objects in Forge, and nearly identical to TileEntityTypes. Since I couldn't find any specific documentation on registering them, here's an example:

    //Entities
    @ObjectHolder("wabbit")
    public static final EntityType<WabbitEntity> wabbit = null;

    @SubscribeEvent
    public static void registerEntities(final RegistryEvent.Register<EntityType<?>> event) {
        LOGGER.debug("Wabbits: Registering Entities...");
        event.getRegistry().registerAll(
                EntityType.Builder.create(WabbitEntity::new, EntityClassification.AMBIENT)
                .build("wabbit").setRegistryName(Constants.MOD_ID, "wabbit");
        );
    } //registerEntities()

There are other files you'll likely want to create, such as a SpearModel (since it looks like you're making a spear). The best thing to do is just search "Trident" in you IDE and look at all the .java and .json files. Piece together what each thing does, and do your best to throw a spear together. You'll learn more as you go along and be able to come back to improve your spear.

EDIT: Also, note that when you make your Renderer, you'll also need to register it. you do that like this:

RenderingRegistry.registerEntityRenderingHandler(WabbitEntity.class, RenderWabbitFactory.INSTANCE);

The second value is a factory. Take a look at this for more info. (https://stackoverflow.com/questions/37126170/irenderfactory-help-in-minecraft-forge)

Edited by TheMikeste1
More details
Link to comment
Share on other sites

12 hours ago, MineModder2000 said:

Bumpity bump bump. 

I think the Trident when held uses a TEISR(TileEntityItemRenderer). Which is attached via the Item Properties you provide in your constructor. As for when it is thrown that's an entity and you need to make your own entity and attach a renderer to it normally, You can probably just extend the TridentRenderer and override getEntityTexture.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

5 hours ago, Animefan8888 said:

I think the Trident when held uses a TEISR(TileEntityItemRenderer). Which is attached via the Item Properties you provide in your constructor. As for when it is thrown that's an entity and you need to make your own entity and attach a renderer to it normally, You can probably just extend the TridentRenderer and override getEntityTexture.

I looked through the vanilla files and the Trident Item class doesn't set it's own TileEntityitemRenderer. As far as extending / copying Trident Renderer, I already figured that, but I don't understand how to link my new Spear Renderer class to the Spear class / objects.

Link to comment
Share on other sites

1 minute ago, MineModder2000 said:

I looked through the vanilla files and the Trident Item class doesn't set it's own TileEntityitemRenderer.

Adding them is a forge addon. Vanilla has them hard coded.

 

2 minutes ago, MineModder2000 said:

but I don't understand how to link my new Spear Renderer class to the Spear class / objects.

What? Spawn your own entity?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

24 minutes ago, Animefan8888 said:

Adding them is a forge addon. Vanilla has them hard coded.

 

What? Spawn your own entity?

Right but there is no class pertaining to Trident within net.minecraft.client.renderer.tileentity, only the Trident Render class within net.minecraft.client.renderer.entity. 

What I am asking is how do I attach or associate my Spear class with that extended Renderer class. 

Link to comment
Share on other sites

3 minutes ago, MineModder2000 said:

Right but there is no class pertaining to Trident within net.minecraft.client.renderer.tileentity, only the Trident Render class

I wonder if it is in the ItemStackTileEntityRenderer class

 

4 minutes ago, MineModder2000 said:

What I am asking is how do I attach or associate my Spear class with that extended Renderer class.

 

7 hours ago, Animefan8888 said:

I think the Trident when held uses a TEISR(TileEntityItemRenderer). Which is attached via the Item Properties you provide in your constructor.

 

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

29 minutes ago, Animefan8888 said:

I wonder if it is in the ItemStackTileEntityRenderer class

 

 

 

Great what am I suppose to do with it? There is a private final trident (TridentModel()) in there. There is also an if statement that checks if it's a trident, and if it is, it sets the texture to the trident one, so know I see why that is. But I change this stuff.....

 

8 hours ago, Animefan8888 said:

I think the Trident when held uses a TEISR(TileEntityItemRenderer). Which is attached via the Item Properties you provide in your constructor. As for when it is thrown that's an entity and you need to make your own entity and attach a renderer to it normally, You can probably just extend the TridentRenderer and override getEntityTexture.

When I said extended Renderer class, I mean the TridentRenderer class. The setTEISR method in Item.Properties only accepts : Supplier<Callable<ItemStackTileEntityRenderer>>, can't pass an extended or copied version of that class. 

Link to comment
Share on other sites

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

    • Slot Gacor >> Mudah Maxwin Bersama Djarum4D   Slot gacor adalah salah satu jenis permainan judi online yang sangat populer di Indonesia. Bermain slot gacor berarti bermain permainan slot dengan kemungkinan keluaran yang lebih tinggi daripada slot tradisional. Dalam artikel ini, kami akan membahas secara lengkap tentang slot gacor, mulai dari pengertian dasar, cara bermain, strategi pemain, serta aspek keamanan dan etika dalam bermain.
    • DAFTAR & LOGIN TAYO4D   Slot gacor online adalah permainan yang menarik dan menghasilkan keuntungan untuk banyak pemain di seluruh dunia. Dalam artikel ini, kita akan membahas tentang cara memilih dan memainkan slot gacor online terbaik.
    • Tayo4D : Bandar Online Togel Dan Slot Terbesar Di Indonesia     Pemain taruhan Tayo4D yang berkualitas memerlukan platform yang aman, terpercaya, dan mudah digunakan. Dalam era teknologi ini, banyak situs online yang menawarkan layanan taruhan togel 4D, tetapi memilih yang tepat menjadi tuntas. Berikut adalah cara untuk membuat artikel yang membahas tentang situs online terpercaya untuk permainan taruhan togel 4D.  
    • OLXTOTO: Platform Maxwin dan Gacor Terbesar Sepanjang Masa OLXTOTO telah menetapkan standar baru dalam dunia perjudian dengan menjadi platform terbesar untuk pengalaman gaming yang penuh kemenangan dan kegacoran, sepanjang masa. Dengan fokus yang kuat pada menyediakan permainan yang menghadirkan kesenangan tanpa batas dan peluang kemenangan besar, OLXTOTO telah menjadi pilihan utama bagi para pencinta judi berani di Indonesia. Maxwin: Mengejar Kemenangan Terbesar Maxwin bukan sekadar kata-kata kosong di OLXTOTO. Ini adalah konsep yang ditanamkan dalam setiap aspek permainan yang mereka tawarkan. Dari permainan slot yang menghadirkan jackpot besar hingga berbagai opsi permainan togel dengan hadiah fantastis, para pemain dapat memperoleh peluang nyata untuk mencapai kemenangan terbesar dalam setiap taruhan yang mereka lakukan. OLXTOTO tidak hanya menawarkan kesempatan untuk menang, tetapi juga menjadi wadah bagi para pemain untuk meraih impian mereka dalam perjudian yang berani. Gacor: Keberuntungan yang Tak Tertandingi Keberuntungan seringkali menjadi faktor penting dalam perjudian, dan OLXTOTO memahami betul akan hal ini. Dengan berbagai strategi dan analisis yang disediakan, pemain dapat menemukan peluang gacor yang tidak tertandingi dalam setiap taruhan. Dari hasil togel yang tepat hingga putaran slot yang menguntungkan, OLXTOTO memastikan bahwa setiap taruhan memiliki potensi untuk menjadi momen yang mengubah hidup. Inovasi dan Kualitas Tanpa Batas Tidak puas dengan prestasi masa lalu, OLXTOTO terus berinovasi untuk memberikan pengalaman gaming terbaik kepada para pengguna. Dengan menggabungkan teknologi terbaru dengan desain yang ramah pengguna, platform ini menyajikan antarmuka yang mudah digunakan tanpa mengorbankan kualitas. Setiap pembaruan dan peningkatan dilakukan dengan tujuan tunggal: memberikan pengalaman gaming yang tanpa kompromi kepada setiap pengguna. Komitmen Terhadap Kepuasan Pelanggan Di balik kesuksesan OLXTOTO adalah komitmen mereka terhadap kepuasan pelanggan. Tim dukungan pelanggan yang profesional siap membantu para pemain dalam setiap langkah perjalanan gaming mereka. Dari pertanyaan teknis hingga bantuan dengan transaksi keuangan, OLXTOTO selalu siap memberikan pelayanan terbaik kepada para pengguna mereka. Penutup: Mengukir Sejarah dalam Dunia Perjudian Daring OLXTOTO bukan sekadar platform perjudian berani biasa. Ini adalah ikon dalam dunia perjudian daring Indonesia, sebuah destinasi yang menyatukan kemenangan dan keberuntungan dalam satu tempat yang mengasyikkan. Dengan komitmen mereka terhadap kualitas, inovasi, dan kepuasan pelanggan, OLXTOTO terus mengukir sejarah dalam perjudian dunia berani, menjadi nama yang tak terpisahkan dari pengalaman gaming terbaik. Bersiaplah untuk mengalami sensasi kemenangan terbesar dan keberuntungan tak terduga di OLXTOTO - platform maxwin dan gacor terbesar sepanjang masa.
    • OLXTOTO - Bandar Togel Online Dan Slot Terbesar Di Indonesia OLXTOTO telah lama dikenal sebagai salah satu bandar online terkemuka di Indonesia, terutama dalam pasar togel dan slot. Dengan reputasi yang solid dan pengalaman bertahun-tahun, OLXTOTO menawarkan platform yang aman dan andal bagi para penggemar perjudian daring. DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI DAFTAR OLXTOTO DISINI Beragam Permainan Togel Sebagai bandar online terbesar di Indonesia, OLXTOTO menawarkan berbagai macam permainan togel. Mulai dari togel Singapura, togel Hongkong, hingga togel Sidney, pemain memiliki banyak pilihan untuk mencoba keberuntungan mereka. Dengan sistem yang transparan dan hasil yang adil, OLXTOTO memastikan bahwa setiap taruhan diproses dengan cepat dan tanpa keadaan. Slot Online Berkualitas Selain togel, OLXTOTO juga menawarkan berbagai permainan slot online yang menarik. Dari slot klasik hingga slot video modern, pemain dapat menemukan berbagai opsi permainan yang sesuai dengan preferensi mereka. Dengan grafis yang memukau dan fitur bonus yang menggiurkan, pengalaman bermain slot di OLXTOTO tidak akan pernah membosankan. Keamanan dan Kepuasan Pelanggan Terjamin Keamanan dan kepuasan pelanggan merupakan prioritas utama di OLXTOTO. Mereka menggunakan teknologi enkripsi terbaru untuk melindungi data pribadi dan keuangan para pemain. Tim dukungan pelanggan yang ramah dan responsif siap membantu pemain dengan setiap pertanyaan atau masalah yang mereka hadapi. Promosi dan Bonus Menarik OLXTOTO sering menawarkan promosi dan bonus menarik kepada para pemainnya. Mulai dari bonus selamat datang hingga bonus deposit, pemain memiliki kesempatan untuk meningkatkan kemenangan mereka dengan memanfaatkan berbagai penawaran yang tersedia. Penutup Dengan reputasi yang solid, beragam permainan berkualitas, dan komitmen terhadap keamanan dan kepuasan pelanggan, OLXTOTO tetap menjadi salah satu pilihan utama bagi para pecinta judi online di Indonesia. Jika Anda mencari pengalaman berjudi yang menyenangkan dan terpercaya, OLXTOTO layak dipertimbangkan.
  • Topics

×
×
  • Create New...

Important Information

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