Jump to content

TallYate

Members
  • Posts

    141
  • Joined

  • Last visited

Everything posted by TallYate

  1. So this should work? @Override public ActionResultType onItemUse(ItemUseContext context) { if(!context.getWorld().isRemote) { if(context.getWorld().getBlockState(context.getPos()).getBlock()==Blocks.BEDROCK) { context.getWorld().setBlockState(context.getPos(), BlockInit.busted_bedrock.getDefaultState(), 3); context.getItem().damageItem(10000, context.getPlayer(), player -> {}); } return ActionResultType.PASS; } else { return ActionResultType.FAIL; } }
  2. @Override public ActionResultType onItemUse(ItemUseContext context) { if(context.getWorld().getBlockState(context.getPos()).getBlock()==Blocks.BEDROCK) { context.getWorld().setBlockState(context.getPos(), BlockInit.busted_bedrock.getDefaultState()); context.getItem().damageItem(10000, context.getPlayer(), player -> {}); } return ActionResultType.PASS; } This works fine, but with another player, they don't see the block change unless they left or right click it. Not including a flag defaults to 3, which should update the block and send the change to clients.
  3. if addPower() accepts floats, just use a float I don't know how that power system works but int power = 2500/1600; float powerLeft = 2500; for(int i=1600; i>0; i--){ //make this run once every tick instead of this for loop, but remember to make i work the same power = powerLeft/i; addPower(power); powerLeft -= power; }
  4. The server doesn't have any errors, it just shows a normal disconnect
  5. This is the error I get when trying to connect This is my mod: https://github.com/TallYate/Bedrock-Things-mod--unfinished-/tree/master/src/main
  6. I changed it to ICraftingRecipe but still have the same issue
  7. So how do I make the crafting table check for my recipe?
  8. I put a recipe that implements this in here: https://github.com/TallYate/Bedrock-Things-mod--unfinished-/blob/master/src/main/resources/data/bedrockthings/recipes/charged_diamond_pickaxe.json The matches part works (I can tell because I made it log stuff), the getRecipeOutput works (I can get a preview of the recipe), and the getIngredients works (the correct ingredients are in the recipe preview). But whenever matches returns true, getCraftingResult doesn't run at all. It doesn't log anything, and the crafting recipe doesn't work.
  9. oops I typed "now" instead of "not"
  10. The matcher returns true, but then the getCraftingOutput does not run. Can you please help me? Here is my mod https://github.com/TallYate/Bedrock-Things-mod--unfinished-
×
×
  • Create New...

Important Information

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