Jump to content

Modding Help 1.14.4


Anonomys

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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;
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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;
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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;
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

    • I tried installing forge for 1.20.6 and for some reason when i open it, it says: "Java Virtual Machine Launcher": Error: Unable to acces jarfile C:\Users\PC\OneDrive\???????????\forge-1.20.6-50.1.0-installer.jar. I dont have any idea what to do. Can anyone help?
    • Update I seem to have fixed it by removing the folders made when the server first starts (e.g. config, world) and starting it all again.  
    • Good days im working on this Costume underground dungeon the plan is creating a mineshaft tunel whit fully functional railway and rail switchs going deep down into the ground      My hypothesis its than than the rails get created before the supporting stone blocks   i was setting blocks whit  Level.setBlock(pos,blkstate,2)  in mode 2 i change it to 10 but the problem persist  in the doorblock class it uses 3 as flag   level.setBlock(p_52750_.above(), p_52751_.setValue(HALF, DoubleBlockHalf.UPPER), 3); i set 3 as flag the problem continues (i du not know what 3 means) this numbers are basically a mistery ===> i need the number mode to set a block into the world whithout doing any checks or triggering neighbors blocks  ############# The nbt class has an Enum to make more redable the code  is in "import net.minecraft.nbt.Tag;" nbtpos = entitydata.getList("blockPos", Tag.TAG_INT);// blockdata contains pos;   if theres something like this for the setBlockMode that would be nice           
    • this is a really old resurrected post  anyway    //values to nbt  ListTag nbtblockpos = new ListTag(); nbtblockpos.add(IntTag.valueOf(blockPos.getX())); nbtblockpos.add(IntTag.valueOf(blockPos.getY())); nbtblockpos.add(IntTag.valueOf(blockPos.getZ())); entitydata.put("blockPos", nbtblockpos); ListTag nbtpos = new ListTag(); nbtpos.add(DoubleTag.valueOf(Pos.x)); nbtpos.add(DoubleTag.valueOf(Pos.y)); nbtpos.add(DoubleTag.valueOf(Pos.z)); entitydata.put("pos", nbtpos);   //getting things back if(entitydata.contains("blockPos")) { nbtpos = entitydata.getList("blockPos", Tag.TAG_INT);// blockdata contains pos this.blockPos = new BlockPos( nbtpos.getInt(0), nbtpos.getInt(1), nbtpos.getInt(2) ); } this.pos = null; if(entitydata.contains("pos")) { nbtpos = entitydata.getList("pos", Tag.TAG_DOUBLE);// blockdata contains pos this.Pos = new Vec3( nbtpos.getDouble(0), nbtpos.getDouble(1), nbtpos.getDouble(2) ); }    
  • Topics

×
×
  • Create New...

Important Information

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