Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

371 profile views

ehbean's Achievements

Tree Puncher

Tree Puncher (2/8)



  1. I'm using Eclipse, and that is the right key shortcut. Just gotta figure out how to get this to work now. Copy pasting the variables, and methods doesn't' seem to work outright so I'll need to do some tweaking.
  2. I feel like looking at those files would be greatly beneficial. Where would I find those?
  3. So adding that line "this.setDefaultState...." to the public BlockState rotate method doesn't seem to get ride of that error there, but I can avoid even needing to override those four methods by changing "CoralPillar extends Blocks" to "CoralPillar extends RotatedPillarBlock"? Wouldn't I need to change how that is loaded during registry so it doesn't crash?
  4. I've been making some blocks in my mod, and I need the blocks to face a certain direction when placed, in a similar way to how a column/pillar will allow you to place it sideways so its top is facing the player. I've found some tutorials online, but they either don't work, or I'm given errors that I can't resolve. I'll post the code of what I've got so far. import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.HorizontalBlock; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.data.BlockModelFields.Rotation; import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.DirectionProperty; import net.minecraft.state.StateContainer; import net.minecraft.util.Mirror; import net.minecraftforge.common.ToolType; public class CoralPillar extends Block { private static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; public CoralPillar() { super(Block.Properties.create(Material.CORAL) .hardnessAndResistance(1.0f, 6.0f) .sound(SoundType.STONE) .harvestLevel(1) .harvestTool(ToolType.PICKAXE)); } @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); } public BlockState rotate(BlockState state, Rotation rot) { return state.with(FACING, rot.rotate(state.get(FACING))); } @Override public BlockState mirror(BlockState state, Mirror mirrorIn) { return state.rotate(mirrorIn.toRotation(state.get(FACING))); } @Override protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { builder.add(FACING); } } The error I'm getting is on line 34, reading "The method rotate(state.get(FACING)) is undefined for the type BlockModelFields.Rotation". I feel like the solution is simple, but I can't figure it out,
  5. I'll make sure to try that when I get there. I still need to create the actual crafting station/furnace. What would you recommend I do or look at to figure that out?
  6. It's been a while since I've worked on a mod of mine, but I want to start again, and I need to make a few different custom crafting stations that act in similar way to brewing stands and furnaces. I've done some digging and I can't seem to find a straight forward example of doing so in 1.16.x. How would I go about making something like that? Is there any way to force slots inside the gui to only take certain items?
  7. Where would I find an example of the class that handles the buckets of items? Also, thank you for the GitHub links. Very useful.
  8. Hey there. I've got a quick 2 part question about crafting recipes. 1. I have a Json file set up that returns and item whenever you craft with it, but I would like it to return two different items. (The recipe has you using a mortar and pestle to grind something). So if at all possible I'd like to return both the mortar, and the other item that is made in the process. 2. How do I go about making a custom crafting station that accepts only certain items, uses a blaze powder as fuel. It would act similarly to a brewing stand, but I'd like to be able to add a new more crafting "options" going into it for later in this mod I'm working on. Thank you
  9. Ultimate goal here is to just make an item that on a right click, is shrunk from the inventory (which I've got down), and then give another, different, item to the player. I'm still learning all the different bits of modding using forge and Minecraft in general, so I apologize if these questions are simple. I am able to give the player an item from the vanilla game, but I can't seem to get it to work with the mod item I've made. So in summary the plan is: Right click empty syringe -> empty syringe is taken from inventory -> blood syringe is given to inventory.
  10. I apologize if this is a dumb question, but would that look like this? public static final RegistryObject<Item> EMPTY_SYRINGE = RegistryHandler.ITEMS.register("empty_syringe", () -> new EmptySyringe(), new ItemStack(EMPTY_SYRINGE.get())); I get an error on the .register, the "new EmptySyringe()" and the "EMPTY_SYRINGE" inside of the new ItemStack. Here are the error messages - The method register(String, Supplier<? extends I>) in the type DeferredRegister<Item> is not applicable for the arguments (String, () -> {}, ItemStack) - Type mismatch: cannot convert from EmptySyringe to I - Cannot reference a field before it is defined I first and second errors are throwing me a bit. The third one, I'm assuming is because its looking for an ItemStack, but there is no ItemStack by the name of EmptySyringe that I've properly defined? Once again, Thank you for your time.
  11. I've looked at the documentation for the method you suggested. I can't seem to find something that exactly matches that. Would it be event.getRegistry() or is that something else? Thank you.
  12. I know I've asked a lot of questions recently, but I hit another wall recently. I've been trying something with ItemHandHelper.giveItemToPlayer(); that is triggered whenever an Item is right clicked. As it stand I can give players an item from the vanilla game, but I can't seem to give any items from my mod. I suspect that it has to do with how I'm registering all the mod items, which looks like this public static final RegistryObject<Item> EMPTY_SYRINGE = RegistryHandler.ITEMS.register("empty_syringe", () -> new EmptySyringe()); Whenever I try to add the argument for a mod item to be given to the player I get the follow error "The constructor ItemStack(RegistryObject<Item>) is undefined". I'm assuming that I need to change the way I'm registering the items or do I need to add another line or two to make it work? Thank you
  13. I've done that. I've got an empty syringe, and a full syringe. I just don't know how to, after invoking the method, remove the full syringe and replace it with an empty syringe.
  14. I see the method there, I just don't know who to have to item that is used back to the player as an empty version. It's not something in a glass bottle as potions are in vanilla. Is there some way to specify that after the use of the item it then takes the item that was used away, then gives its empty counterpart? Sorry if this is vauge.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.