• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Okey   @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn){ ServerWorld world = (ServerWorld) worldIn; world.addLightningBolt(new LightningBoltEntity(world, playerIn.posX, playerIn.posY, playerIn.posZ, false)); return new ActionResult<>(ActionResultType.SUCCESS, playerIn.getHeldItem(handIn)); }   It won't allow me to do cast it like this. It crashes. The crash report say the following:   java.lang.ClassCastException: net.minecraft.client.world.ClientWorld cannot be cast to net.minecraft.world.server.ServerWorld    
    • When starting up my game, the game will crash after the loading, presenting me with this, " The game crashed whilst there was a severe problem during mod loading that has caused the game to fail Error: net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Tough As Nails (toughasnails) ." Crash Report: https://pastebin.com/zzTdfsDb Debug Log: https://pastebin.com/bgxJtFgs
    • Hi, I am trying to write a custom command that finds specific blocks (with certain blockstates) and replaces them with other blocks with specific blockstates. I tried capturing a blockstate like this: BlockState sourceblock = Blocks.RED_GLAZED_TERRACOTTA.getDefaultState().with(BlockStateProperties.FACING, Direction.NORTH); and it crashes. What am I doing wrong? BTW: If I do it without the ".with(BlockStateProperties.FACING, Direction.NORTH)" part it works but then I can't get a specific blockstate. I don't want to replace all of a particular block, just all of a particular blockstate, like all red_glazed_terracotta[facing=north]. I also need to make sure I can build a similar blockstate for the destination block to replace with. In 1.12.2 I did it like this: BlockState sourceblock = convertArgToBlockState(Blocks.RED_GLAZED_TERRACOTTA, "0") The reason I want a blockstate is that I can do world.getBlockState(tempBlockPos) followed by a if check then a world.setBlockState(tempBlockPos, replaceItem.newBlockState, 2);   Am I doing something wrong with my BlockState? Is there a better way to do this (without resorting to typing in the fill command)? Thank you for any help.
    • No it is not. Just send them as raw types. int, double, float ect. No use the @ObjectHolder annotation to give them values.
  • Topics

  • Who's Online (See full list)