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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Update: I managed to make the item not disappear after crafting, but it doesn't remove any durability. import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.Enchantments; import net.minecraft.enchantment.UnbreakingEnchantment; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class NuggetHammer extends Item { private boolean damage; public NuggetHammer(Properties p_i48487_1_) { super(p_i48487_1_); } @Override public int getMaxDamage(ItemStack stack) { return 54 - 1; } public boolean isBarVisible(ItemStack stack) { return false; } @Override public ItemStack getContainerItem(ItemStack stack) { ItemStack copy = stack.copy(); copy.setCount(1); if (!this.damage) return copy; int unbreaking = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.UNBREAKING, stack); for (int i = 0; i < unbreaking; i++) { if (UnbreakingEnchantment.shouldIgnoreDurabilityDrop(stack, unbreaking, random)) return copy; } copy.setDamageValue(stack.getDamageValue() + 1); if (copy.getDamageValue() > stack.getMaxDamage()) return ItemStack.EMPTY; return copy; } }  
    • I cannot find the answer anywhere public static void onPlayerConsumeXp(PlayerXpEvent.PickupXp event){ if(event.getEntity().getMainHandItem().getAllEnchantments().get(*value i need*) != null){ int shorthand = event.getEntity().getMainHandItem().getAllEnchantments().get(*value i need*); I am trying to get my custom enchant inside that *value i need*, I have tried using strings and Enchantments. does not show my enchantment. This is my enchantment class package net.test.tutorialmod.enchants; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; public class clever extends Enchantment { public clever(Rarity pRarity, EnchantmentCategory pCategory, EquipmentSlot... pApplicableSlots) { super(pRarity, pCategory, pApplicableSlots); } @Override public int getMaxLevel() { return 10; } @Override public int getMinLevel() { return 1; } }  What am i doing wrong?  
    • I had this same issue, it was one of the mods I had installed, some mods seem to break with certain versions of forge and cause others to break as well, trial and error different mods till you find the broken one.  
    • Hi, I'm asking for your help because I can't figure out how to make it so that when an item is crafted on the Crafting Table, it returns the item to the player's inventory and makes the item lose durability. I've tried looking everywhere without success. Like for the crafting of the cake which returns the empty bucket to the player, but also makes it lose durability.  
  • Topics

×
×
  • Create New...

Important Information

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