Jump to content

Recommended Posts

Posted

Im trying to learn how to add blocks to minecraft,i want to add a cake block, i dont care if at first its a full block like cobblestone or wood, i just want to add it to the game succesfully, but i cant manage to create the block  object  in my BlockBase  class. 


image.png.0f6394ecb0a50879f6e22e4612e83f71.png 

 

i do have a RegistryHandler, althought i dont really know how it works as i started with a video guide that helped me set everything up.

image.png.86277cf4a1f0c092001490403bbce22f.png

 

I created succesfully the item TARTA_FRESA but i cant manage to create the block (im trying to create a food item that you can place on the floor like a cake).

image.png.6eb72732acf2d44e4e298f7fbdec6347.png

 

Help is apreciated.

 

Posted
3 hours ago, CapuchasPlz said:

image.png.0f6394ecb0a50879f6e22e4612e83f71.png 

 

Uh...have you tried fixing that error right there?

Also, don't use BlockBase (Code Style #4).

3 hours ago, CapuchasPlz said:

I created succesfully the item TARTA_FRESA but i cant manage to create the block (im trying to create a food item that you can place on the floor like a cake).

You do realize that your item needs to know about your block in order to place it, right?

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
19 hours ago, Draco18s said:

Uh...have you tried fixing that error right there?

Also, don't use BlockBase (Code Style #4).

You do realize that your item needs to know about your block in order to place it, right?

hello thank you for your reply, i was asking myself how would i create other items like materials if i make the constructor for items always drop em in food.

 

i fixed that, but my problem persist, i tried to do numerous stuff to get the constructor working but i cant, it wask me to adda material, but then says the constructor Block(Block) is undefined what should i do.

image.png.063fb5a64778c9fa454d68ac0b060098.png

 

Right now i have null inside the constructor, but i have tried things like Block(.material.cake) or Block(.properties.sethardnesslevel) but nothing works and keeps giving me the same error


Help is much apreciated

Posted
20 hours ago, Draco18s said:

Uh...have you tried fixing that error right there?

Also, don't use BlockBase (Code Style #4).

You do realize that your item needs to know about your block in order to place it, right?

and how do i code that, i tried to find a tutorial or search in the api and docs, but its hard to understand what classes, functions or atributes i have to use.

Posted
3 hours ago, CapuchasPlz said:

how could i do that when i right click with the item it places that block?

Vanilla already has this item. Its called BlockItem or NamedBlockItem (both have slightly different features).

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.

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.