Jump to content

SLOVED[1.7.10]How to use NBT for BlockDoor


FLUFFY2

Recommended Posts

Hello,

I have a working custom door, but i want to make it lockable.

To save the data i want to use NBT, but that needs a TileEntity.

For that i have to extend BlockContainer, but i can't because then the door will not work.

So, how can i use NBT fo a block that extends BlockDoor?

Thanks!

Link to comment
Share on other sites

Hello,

I have a working custom door, but i want to make it lockable.

To save the data i want to use NBT, but that needs a TileEntity.

For that i have to extend BlockContainer, but i can't because then the door will not work.

So, how can i use NBT fo a block that extends BlockDoor?

Thanks!

 

src pls

Here could be your advertisement!

Link to comment
Share on other sites

Never mind just figured out.

I have to make a custom BlockDoor class that extends BlockContainer.

So my door now extends CustomBlockDoor and its working!

Just wanted to post this:

 

 

package net.dimensionshift.mod.block;

 

import net.dimensionshift.mod.DimensionShift;

import net.dimensionshift.mod.energy.TileEntityBasicWire;

import net.dimensionshift.mod.tileentity.TileEntityAncientDimensionStoneBricks;

import net.minecraft.block.BlockContainer;

import net.minecraft.block.material.Material;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.World;

 

public class BlockAncientDimensionStoneBricks extends BlockContainer{

 

public BlockAncientDimensionStoneBricks(Material material) {

super(material);

this.setCreativeTab(DimensionShift.tabDimensionshift);

 

}

 

@Override

public TileEntity createNewTileEntity(World var1, int var2) {

 

return new TileEntityAncientDimensionStoneBricks();

}

 

}

 

 

 

 

 

that would have been such an easy "thank you" D;...

 

@MultiMote, i think he only asked for the TileEntity, not for the nbt

Here could be your advertisement!

Link to comment
Share on other sites

@MultiMote: Thanks, but just figured out how to do it. The tut is realy good, but i want to write my system.

 

@Jacky2611: I already know how to use NBT for a normal block.

 

 

I probably try harder next time before instant requesting for help.

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



×
×
  • Create New...

Important Information

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