Jump to content

Recommended Posts

Posted
13 minutes ago, deerangle said:

I want to create a custom sign block. Ideally, I could just add my Sign blocks to the existing TileEntityType SIGN. Is that possible, or do I have to make my own TileEntity?

Each TileEntityType has a Set<Block> which are the valid Blocks for that TileEntityType. So you will need your own TileEntity. However you can just extend SignTileEntity and override the constructor that takes no Parameters and pass your own TileEntityType into the super 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.

Posted
1 minute ago, Animefan8888 said:

However you can just extend SignTileEntity and override the constructor that takes no Parameters and pass your own TileEntityType into the super constructor.

I'm a little confused on how to do this, as the signature of the constructor for SignTileEntity is this:

public SignTileEntity() {
    super(TileEntityType.SIGN);
}

So I can't pass my own TileEntityType to it.

Posted
6 minutes ago, deerangle said:

So I can't pass my own TileEntityType to it.

 

12 minutes ago, Animefan8888 said:

So you will need your own TileEntity. However you can just extend SignTileEntity and override the constructor that takes no Parameters and pass your own TileEntityType into the super 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.

Posted
public class BeechSignTileEntity extends SignTileEntity {

    public BeechSignTileEntity() {
        super(Registry.SIGN_TE); // doesn't work
    }

}

I made my own TileEntity. I extended SignTileEntity. However, I can't pass my TileEntityType to the superconstructor because the superconstructor doesn't accept a TileEntityType.

Posted
1 minute ago, diesieben07 said:

That is not how constructors work.

This is true. Don't I look like a fool.

 

Just now, deerangle said:

I made my own TileEntity. I extended SignTileEntity.

Instead override TileEntity::getType and return your own type.

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.

Posted
2 minutes ago, diesieben07 said:

This breaks certain mods, because the type will be invalid during AttachCapabilitiesEvent. Do not do this.

Why would the type be invalid during AttachCapabilitiesEvent?

 

AttachCapabilitiiesEvent<TileEntity> gives you the TileEntity object not the TileEntityType and the event is fired when the TileEntity is constructed aka when the block is placed. By then the Type has been registered and the TileEntity::type field is private and there is a TileEntity::getType so no need to use Reflection to access it.

 

I fail to miss how this breaks certain mods.

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.

Posted
Just now, diesieben07 said:

AttachCapabilitiesEvent is fired from the TileEntity constructor. Your own constructor has not ran yet, as such anything in your tile entity class (including a potential TileEntityType field) is not initialized.

I said to override the getType method I assume

public TileEntityType<?> getType() {
  return MyTileEntityTypes.MY_SIGN_TYPE;
}

Would work just fine.

  • Like 1

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.

  • 3 months later...
Posted

Can you post your solution? I'm lost on how I'm supposed to pass my custom SignTileEntity to the  SignItem class. I have my custom SignTileEntity extend Minecraft's SignTileEntity and override the TileEntity::GetType so that it returns my custom SignTileEntityType. But my custom SignTileEntity::GetType is never called. When I place my custom SignItem into the world it calls world.getTileEntity which somehow returns Minecraft's SignTileEntity (I tried following it in the debugger and it wouldn't reveal where it gets the tile entity from).

Posted (edited)
31 minutes ago, killerjdog51 said:

But my custom SignTileEntity::GetType is never called.

Of course not, because the vanilla sign item places the vanilla sign block, and the vanilla sign block creates the vanilla sign tile entity.

GetType only gets called for the game to determine how to serialize and deserialize the TE's data.

Edited by Draco18s

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.

Posted (edited)
18 hours ago, Draco18s said:

Of course not, because the vanilla sign item places the vanilla sign block, and the vanilla sign block creates the vanilla sign tile entity.

GetType only gets called for the game to determine how to serialize and deserialize the TE's data.

Thank you, I got it working and I really appreciate your help. I can't believe how stupid I was though, I checked the sign blocks to see if there was anything related to tile entities, didn't even notice that they were extending an abstract sign class. This whole time I was looking for how the Item class called the tile entity.

 

The last thing I need then is texturing my sign blocks, Now that I can actually place it in the world I see that they all have the oak texture instead of my custom sign textures (placed in assets/Mod_ID/textures/entity/signs folder)

 

Edit: figured out the texture thing, just had to make a TileEntityRenderer class. 

Edited by killerjdog51
Solved

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

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

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