Jump to content

Recommended Posts

Posted

I was wondering how to add custom food into Minecraft 1.14.4. And make custom AxisAlignedBB.. I need it because I want to make my mod from 1.12.2 into 1.14.4. And I need help with AxisAlignedBB and Custom Foods.

This is my signature. I don't really too much know about java but i try to help and i try to get help from others too. Thank you!

Posted

Food is no longer its own item, instead you have to specify the food in the item's properties. Take a look at the Food class for details, as well as how vanilla uses it; you'll have to use its builder to create a new food.

As for AABBs, are you talking about blocks or entities? If it's for blocks, look into the VoxelShape class. Browse around the vanilla code to see how its used.

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

Posted
5 minutes ago, imacatlolol said:

Food is no longer its own item, instead you have to specify the food in the item's properties. Take a look at the Food class for details, as well as how vanilla uses it; you'll have to use its builder to create a new food.

As for AABBs, are you talking about blocks or entities? If it's for blocks, look into the VoxelShape class. Browse around the vanilla code to see how its used.

But I don't know how to use it. Do I copy everything in the food class or ….. if its not a problem please tell me how to do it. Im new in 1.14 I was used to 1.12.

 

This is my signature. I don't really too much know about java but i try to help and i try to get help from others too. Thank you!

Posted

First, you need to create a food type:
 

public static final Food MYFOOD = (new Builder()).hunger(4).saturation(0.3F).build();

 

Then, when you register an item, you include it in its properties:
 

event.getRegistry().register("myfood", new Item((new Item.Properties().food(MYFOOD)).group(ItemGroup.FOOD)));


It's that easy.

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;
Posted (edited)
11 minutes ago, Legenes said:

First, you need to create a food type:
 


public static final Food MYFOOD = (new Builder()).hunger(4).saturation(0.3F).build();

 

Then, when you register an item, you include it in its properties:
 


event.getRegistry().register("myfood", new Item((new Item.Properties().food(MYFOOD)).group(ItemGroup.FOOD)));


It's that easy.

Thank you so much!!!!! But what does .food(MYFOOD) mean? Is that class of the food/item?

Edited by Anonomys

This is my signature. I don't really too much know about java but i try to help and i try to get help from others too. Thank you!

Posted
25 minutes ago, Anonomys said:

Thank you so much!!!!! But what does .food(MYFOOD) mean? Is that class of the food/item?

That's the Food type that we just created in my example.

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;
Posted
1 hour ago, Legenes said:

That's the Food type that we just created in my example.

then what is that food class or idk. What do I need to type in food class or something else?

This is my signature. I don't really too much know about java but i try to help and i try to get help from others too. Thank you!

Posted (edited)

Nope my theory doesn't work

Edited by Anonomys

This is my signature. I don't really too much know about java but i try to help and i try to get help from others too. Thank you!

Posted
7 minutes ago, Anonomys said:

Nope my theory doesn't work

You have a class where you store all your block's and item's variables. You declare a "food" variable as I showed you here.

2 hours ago, Legenes said:

public static final Food MYFOOD = (new Builder()).hunger(4).saturation(0.3F).build();

Then, when you register them, by default in your main mod class, at the event registry, you add this food variable, as the food property. In THIS example, the food variable's name is MYFOOD.

2 hours ago, Legenes said:

event.getRegistry().register("myfood", new Item((new Item.Properties().food(MYFOOD)).group(ItemGroup.FOOD)));

procedure WakeMeUp(Integer plusTime);
var
  I: Integer;
begin
  for I := 0 to plusTime do begin
    println('One more minute!');
    Sleep(1000);
  end;
  println('Okay, nothing to worry, I''m alive!');
  println('So... somebody can give me a coffee?');
  println('I know it''s Pascal, and not Java, but I love it :D.');
end;

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.