Jump to content

Recommended Posts

Posted

Hi

 

I would like to make some vanilla blocks water loggable, how would I go about doing that? I have to add the property WATERLOGGED to the block first, then I have to add the IWaterLoggable interface together with its methods. Making my own block class adding that is super easy, but adding it to vanilla blocks  I have no idea how to do.

Posted
2 hours ago, diesieben07 said:

You need to replace the registry entries for the blocks. Basically just give your own block instance the same registry name of the one you want to overwrite.

Note that:

  1. Only one mod can do this per block (obviously).
  2. Your block cannot change the block state properties of the original block, because that would break world saves.

 

Ok, so tried that, but it ended up with it complaining that I can't change the order of block properties, so I changed the order of it, same thing. Then I removed it just to see what it said then and then the game crashed due to it not finding the waterlogged property on the block.

 

@Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder)
{
    super.fillStateContainer(builder); // Doesn't matter which order they are in, still complains. Removing WATERLOGGED crashes the game.
    builder.add(WATERLOGGED);
}

 

How do I avoid that?

Posted
2 hours ago, diesieben07 said:

Your block cannot change the block state properties of the original block, because that would break world saves.

Or do you mean by that I can't add new properties to it? I thought you meant I can't remove existing block properties or change how they behave and the range of example an int range.

Posted
19 minutes ago, Simon_kungen said:

Or do you mean by that I can't add new properties to it? I thought you meant I can't remove existing block properties or change how they behave and the range of example an int range.

You can't CHANGE them. That means no adding, no removing.

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
9 minutes ago, Draco18s said:

You can't CHANGE them. That means no adding, no removing.

Hmm... so my best bet is to just make a new block under my mod id and replace the vanilla block recipe to give my block instead?

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

    • Delete the config of RandomTweaker (config folder) If there is no change, remove this mod
    • Hello! So i have been trying to make a mod that adds plant fiber to minecraft 1.16.5 (i believe there are mods that add plant fiber but not for 1.16.5) but the problem is that i want to modify the loot table of grass to always drop plant fiber but also keep the vanilla drops. Most common answer i have seen is GlobalLootModifiers. But my tiny brain cant understand any tutorials. So any help is appreciated.
    • Minecraft forge 1.12.2 does not load. Here is both logs. I assume its because of a mod that i have, idk. (L521)
    • Found the solution! Instead of using PlayerEvent.Clone to sync capabilities with a client use EntityJoinWorldEvent! That's how CapabilitySync class should look like: public class CapabilitySync { @SubscribeEvent public void EntityJoinWorldEvent(EntityJoinWorldEvent event) { Entity entity = event.getEntity(); if (entity.world.isRemote || !(entity instanceof EntityPlayerMP)) return; EntityPlayer player = (EntityPlayer) entity; NetworkHandler.channel.sendTo(new ServerToClient(player), (EntityPlayerMP) player); } @SubscribeEvent public void onPlayerClone(PlayerEvent.Clone event) { EntityPlayer player = event.getEntityPlayer(); IFolder folder = player.getCapability(FolderProvider.FOLDER_CAP, null); IFolder oldfolder = event.getOriginal().getCapability(FolderProvider.FOLDER_CAP, null); folder.setFolders(oldfolder.getFolders()); } }   Here is a full code if you need one! https://github.com/R4L34/capabilitynetworking
×
×
  • Create New...

Important Information

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