Jump to content

Imported a block into Forge but it's not doing it as I guessed + Icon


Flurry

Recommended Posts

The image that I have provided shows the Blockbench model I have loaded in, I don't know why it's showing an empty space underneath, also I wanted to know how to set an icon for the certain block. I have a BlockItem + Block itself to make it work.

 

Does anybody have solutions towards both of these?

(P.S I watched Harry Talks tutorials, but I tried to make it from block bench instead of other resources.)

Screen Shot 2019-10-13 at 7.02.53 PM.png

Link to comment
Share on other sites

20 minutes ago, Flurry said:

(P.S I watched Harry Talks tutorials

His tutorials are notoriously bad there have been several posts on here where they've said they've followed them and many bad practices later they end up with problems and come here.

 

You need a model for the item as well if you need an example take a look in the minecraft jars under assets/models/items/any_block.json where any_block is any block in the game.

 

The problem you are having with seeing through the world is solved by overriding getRenderLayer in your blocks class. If it doesn't have a class right now make one. The return value for this method should be BlockRenderLayer.CUTOUT.

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

 
 
 
 
2 hours ago, Animefan8888 said:

The problem you are having with seeing through the world is solved by overriding getRenderLayer in your blocks class. If it doesn't have a class right now make one. The return value for this method should be BlockRenderLayer.CUTOUT.

I understand the rest, yet I don't know what you mean by this?

Link to comment
Share on other sites

3 minutes ago, Flurry said:

I understand the rest, yet I don't know what you mean by this?

That was basic Java. What specifically are you having problems with?

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

22 minutes ago, Animefan8888 said:

That was basic Java. What specifically are you having problems with?

public class BlockList 

{

public static Block dog_house;

 

public BlockRenderLayer getRenderLayer()

{

return BlockRenderLayer.CUTOUT;

}

}

 

Is this the way you wanted it to be?

Link to comment
Share on other sites

Just now, Flurry said:

Is this the way you wanted it to be?

No.

 

2 hours ago, Animefan8888 said:

overriding getRenderLayer in your blocks class.

Aka when you give dog_house a value you need to use your own class and that class needs to override getRenderLayer. If this is something you don't understand I recommend that you look up some tutorials on Java,

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

4 minutes ago, Animefan8888 said:

No.

 

Aka when you give dog_house a value you need to use your own class and that class needs to override getRenderLayer. If this is something you don't understand I recommend that you look up some tutorials on Java,

What would be some tutorials that would match with what I need to know?

Link to comment
Share on other sites

Just now, Flurry said:

What would be some tutorials that would match with what I need to know?

Anything that talks about inheritance, classes, and objects.

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

9 hours ago, Animefan8888 said:

Anything that talks about inheritance, classes, and objects.

I was looking at some tutorials (thanks to thenewboston), and the discussion about inheritance was good.

 

So what would I need to inherit in my block class specifically and such? 
(P.S, I'm still looking into the classes & objects.)

Link to comment
Share on other sites

39 minutes ago, Flurry said:

So what would I need to inherit in my block class specifically and such? 

You need to override the named method correctly.

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

Generally speaking, you can only override a method in a class that is, itself, a subclass of the class where the method to be overridden is found. So in order to override a method in the Block class you have to do so in a subclass that extends Block.

 

You would know this if you had any knowledge of object oriented programming already. A thing that we here at Forge, don't teach, because there's already a billion other resources for it, like Stack Overflow. All we help people with is finding the right method in Minecraft or Forge that does the thing that they need. We've done that, we've told you to override getRenderLayer, what to return, and where it goes.

 

(Oh, by the way, if you show up at Stack Overflow and post this exact question, I'll see it and almost certainly vote to close it for being unclear or too broad or looking for off-site resources)

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.

Link to comment
Share on other sites

13 minutes ago, Draco18s said:

Generally speaking, you can only override a method in a class that is, itself, a subclass of the class where the method to be overridden is found. So in order to override a method in the Block class you have to do so in a subclass that extends Block.

 

You would know this if you had any knowledge of object oriented programming already. A thing that we here at Forge, don't teach, because there's already a billion other resources for it, like Stack Overflow. All we help people with is finding the right method in Minecraft or Forge that does the thing that they need. We've done that, we've told you to override getRenderLayer, what to return, and where it goes.

 

(Oh, by the way, if you show up at Stack Overflow and post this exact question, I'll see it and almost certainly vote to close it for being unclear or too broad or looking for off-site resources)

Do you think I should make a block class for the specific block that I'm wanting to be put into the game itself? Or have a BlockList?

(I forgot to mention this.)

Link to comment
Share on other sites

Lets follow the logic here.

 

"I need to override this method in my block class in order to get the behavior I want."

 

Now answer the question, "Do I need my own block class?"

 

Yes:

Spoiler

Of course, where else would you put the overridden method?

No:

Spoiler

I'm open to suggestions on how you're going to accomplish this. Good luck, have fun!

 

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

24 minutes ago, Draco18s said:

Lets follow the logic here.

 

"I need to override this method in my block class in order to get the behavior I want."

 

Now answer the question, "Do I need my own block class?"

 

Yes:

  Reveal hidden contents

Of course, where else would you put the overridden method?

No:

  Reveal hidden contents

I'm open to suggestions on how you're going to accomplish this. Good luck, have fun!

 

Thank you so much!
One more thing before I hit the road (is that how people say it?)

 

"1": "assets:blocks/hardened_clay_stained_silver",

"2": "assets:blocks/hardened_clay_stained_purple"

 

These are the textures I selected for the certain model I wanted, (changed up the colors cause why not)

But yet they won't go in, is it because I selected some of the default textures from Minecraft client itself or?

If so, what do I put to resolve this issue?

Link to comment
Share on other sites

33 minutes ago, Flurry said:

assets:blocks/hardened_clay_stained_silver

What is the actual file path you have these in?

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

43 minutes ago, Flurry said:

"1": "assets:blocks/hardened_clay_stained_silver",

"2": "assets:blocks/hardened_clay_stained_purple"

 

These are the textures I selected for the certain model I wanted, (changed up the colors cause why not)

But yet they won't go in, is it because I selected some of the default textures from Minecraft client itself or?

If so, what do I put to resolve this issue?

 

I suspect the problem here is that "assets" is not a proper domain name. But yes, as Animefan8888 asks, can you post the entire json file in question?

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

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

    • They were already updated, and just to double check I even did a cleanup and fresh update from that same page. I'm quite sure drivers are not the problem here. 
    • i tried downloading the drivers but it says no AMD graphics hardware has been detected    
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
  • Topics

×
×
  • Create New...

Important Information

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