• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Hello. I'm making a conveyor mod, so I need the entity to move based on the blocks direction property, here named FACING. I think I'll need to use If to get this to work, but I can't find how to compare the FACING variable properly. How would I do this? I've tried to figure it out by logging the variable whenever the block is walked on, but that only puts out this: DirectionProperty{name=facing, clazz=class net.minecraft.util.Direction, values=[north, south, west, east]} Here's my code: private static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; public ConveyorBlock() { super(Block.Properties.create(Material.IRON) .hardnessAndResistance(4.0f, 5.0f) .sound(SoundType.METAL) .harvestLevel(2) .harvestTool(ToolType.PICKAXE) .func_235859_g_()); } @Nullable @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); } @Override 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); } @Override public void onEntityWalk(World worldIn, BlockPos pos, Entity entityIn) { Vector3d v = entityIn.getMotion(); DirectionProperty facing = FACING; BlocksthatMoveyou.LOGGER.info(facing); BlocksthatMoveyou.LOGGER.info("Player walked on conveyor!"); if (FACING == north) //This was one of the ways I tried doing it, but it can't resolve the symbol I also tried putting it in quotes entityIn.setMotion(v.x, -v.y, v.z); }
    • I've fixed the issue switching to 1.16.3-forge-34.1.25
    • Hi, I've been trying to make a modded lantern using net.minecraft.block.LanternBlock as a base.   My current class is as follows:   import net.minecraft.block.*; import net.minecraft.block.material.Material; import net.minecraftforge.common.ToolType; public class GemLanternBase extends LanternBlock { public GemLanternBase(int lightValue) { super(LanternBlock.Properties.create(Material.IRON) .hardnessAndResistance(3.5f, 3.5f) .sound(SoundType.LANTERN) .harvestLevel(0) .harvestTool(ToolType.PICKAXE) .setLightLevel(value -> lightValue)); } }   I figured that using the default lantern would mean that the model in-game would support transparency, but I seem to be wrong. The modded lantern has one difference to the default one, the chain texture doesn't support transparency. It's really annoying and I have no idea what I need to do in order to fix this. Is anyone able to help me on this one? (p.s. I'm quite new to modding so treat me like I'm an idiot, thanks :D)
    • Yeah that's kind of what I figured. I haven't touched forge since 1.7.10 so I don't really know how this whole data-oriented crafting system works...
    • If the NBT is not static then yes you need a custom recipe.
  • Topics

  • Who's Online (See full list)