I've been making a mod with eclipse and I wanted to create a custom block which is 2 blocks long; but everytime I test it, the block wont render and it just has that purple and black pattern. Could somebody please tell me why this is happening? Does it have something to do with me not putting "NORTH1" or "NORTH2" for example, in the block rotation code even though I put them in the item script? Thanks, here's the code:
I've been making a mod with eclipse and I wanted to create a custom block which is 2 blocks long; but everytime I test it, the block wont render and it just has that purple and black pattern. Could somebody please tell me why this is happening? Does it have something to do with me not putting "NORTH1" or "NORTH2" for example, in the block rotation code even though I put them in the item script? Thanks, here's the code:
Script for block rotation:
{{ "variants": { "facing=north, lit=false": { "model": "tutorialmod:block/hydraulic_metal_roller", "y": 270 }, "facing=east, lit=false": { "model": "tutorialmod:block/hydraulic_metal_roller", "y": 0 }, "facing=south, lit=false": { "model": "tutorialmod:block/hydraulic_metal_roller", "y": 90 }, "facing=west, lit=false": { "model": "tutorialmod:block/hydraulic_metal_roller", "y": 180 }, "facing=north, lit=false": { "model": "tutorialmod:block/hydraulic_metal_roller", "y": 90 }, "facing=east, lit=false": { "model" : "tutorialmod:block/hydraulic_metal_roller", "y": 180 }, "facing=south, lit=false": { "model": "tutorialmod:block/hydraulic_metal_roller", "y": 270 }, "facing=west, lit=false": { "model": "tutorialmod:block/hydraulic_metal_roller", "y": 0 } }}
script for item:
package com.DinoPvP.tutorialmod.block;package com.DinoPvP.tutorialmod.block;
import net.minecraft.core.BlockPos;import net.minecraft.core.Direction;import net.minecraft.world.InteractionHand;import net.minecraft.world.InteractionResult;import net.minecraft.world.InteractionResultHolder;import net.minecraft.world.entity.player.Player;import net.minecraft.world.item.ItemStack;import net.minecraft.world.item.Items;import net.minecraft.world.item.context.BlockPlaceContext;import net.minecraft.world.level.BlockGetter;import net.minecraft.world.level.Level;import net.minecraft.world.level.LevelAccessor;import net.minecraft.world.level.block.Block;import net.minecraft.world.level.block.HorizontalDirectionalBlock;import net.minecraft.world.level.block.Mirror;import net.minecraft.world.level.block.Rotation;import net.minecraft.world.level.block.state.BlockState;import net.minecraft.world.level.block.state.StateDefinition.Builder;import net.minecraft.world.level.block.state.properties.BooleanProperty;import net.minecraft.world.level.block.state.properties.DirectionProperty;import net.minecraft.world.phys.BlockHitResult;import net.minecraft.world.phys.shapes.CollisionContext;import net.minecraft.world.phys.shapes.Shapes;import net.minecraft.world.phys.shapes.VoxelShape;
public class HydraulicMetalRoller extends Block { public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING; public static final BooleanProperty LIT = BooleanProperty.create("lit"); public static final VoxelShape NORTH = Shapes.box(-0.5723749999999996, 0, 0.22850000000000104, 0.7101250000000003, 0.4275, 0.7415000000000007); public static final VoxelShape NORTH1 = Shapes.box(-0.7904000000000002, 0, 0.2669750000000011, -0.5766500000000001, 0.3847499999999999, 0.7030250000000007); public static final VoxelShape NORTH2 = Shapes.box(0.7229500000000003, 0.08549999999999996, 0.2669750000000011, 0.8682999999999996, 0.8549999999999998, 0.7030250000000007); public static final VoxelShape NORTH3 = Shapes.box(0.6665199999999992, 0.08549999999999996, 0.23277500000000018, 0.7092699999999998, 0.8549999999999998, 0.737225); public static final VoxelShape NORTH4 = Shapes.box(-0.57152, 0.08549999999999996, 0.23277500000000018, -0.5287699999999995, 0.8549999999999998, 0.737225); public static final VoxelShape NORTH5 = Shapes.box(0.6887500000000012, 0.6754500000000014, 0.2798000000000025, 0.7314999999999985, 0.8464499999999986, 0.6987499999999989); public static final VoxelShape NORTH6 = Shapes.box(0.03894999999999871, 0.363375, 0.22422500000000034, 0.09879999999999911, 0.40612499999999996, 0.23277500000000018); public static final VoxelShape NORTH7 = Shapes.box(-0.7433750000000003, 0.18809999999999993, 0.2627000000000004, -0.6151250000000001, 0.3591, 0.2712500000000002); public static final VoxelShape NORTH8 = Shapes.box(-0.6963499999999991, 0.2992499999999999, 0.2584249999999997, -0.6621499999999998, 0.33345, 0.2669749999999995); public static final VoxelShape NORTH9 = Shapes.box(-0.6963499999999991, 0.21375, 0.2584249999999997, -0.6621499999999998, 0.2479499999999999, 0.2669749999999995); public static final VoxelShape NORTH10 = Shapes.box(-0.5338999999999996, 0.5984999999999998, 0.5704999999999998, 0.68875, 0.6412499999999999, 0.6132500000000003); public static final VoxelShape NORTH11 = Shapes.box(-0.5338999999999996, 0.5984999999999998, 0.3567499999999999, 0.68875, 0.6412499999999999, 0.3995000000000004); public static final VoxelShape NORTH12 = Shapes.box(-0.5338999999999996, 0.6840000000000002, 0.46362499999999973, 0.68875, 0.72675, 0.5063750000000005); public static final VoxelShape NORTH13 = Shapes.box(-0.7561999999999993, 0.04275000000000001, 0.2584249999999997, -0.7220000000000002, 0.07694999999999996, 0.2669749999999995); public static final VoxelShape NORTH14 = Shapes.box(-0.5809249999999995, 0.3847499999999999, 0.2199500000000012, 0.7186750000000002, 0.3954375, 0.7500500000000005); public static final VoxelShape NORTH15 = Shapes.box(-0.689937499999999, 0.17100000000000004, 0.69875, -0.6792499999999995, 0.1816875, 0.7415000000000007); public static final VoxelShape NORTH16 = Shapes.box(-0.7690249999999998, 0, 0.7414999999999992, -0.5980250000000005, 0.3420000000000001, 0.8697499999999994); public static final VoxelShape NORTH17 = Shapes.box(-0.7818499999999988, 0.06840000000000002, 0.7910900000000005, -0.7647499999999992, 0.1025999999999998, 0.81674); public static final VoxelShape NORTH18 = Shapes.box(-0.7818499999999988, 0.25649999999999995, 0.7910900000000005, -0.7647499999999992, 0.29069999999999974, 0.81674); public static final VoxelShape NORTH19 = Shapes.box(-0.7091749999999997, 0.33345, 0.779974999999999, -0.6578749999999993, 0.3505499999999999, 0.8312749999999995); public static final VoxelShape NORTH20 = Shapes.box(-0.5338999999999996, 0.7694999999999999, 0.46362499999999973, 0.68875, 0.8122499999999999, 0.5063750000000005); public static final VoxelShape NORTH21 = Shapes.box(-0.4996999999999989, 0.04275000000000001, 0.21994999999999965, -0.4654999999999996, 0.07694999999999996, 0.22849999999999948); public static final VoxelShape NORTH22 = Shapes.box(-0.4996999999999989, 0.2992499999999999, 0.21994999999999965, -0.4654999999999996, 0.33345, 0.22849999999999948); public static final VoxelShape NORTH23 = Shapes.box(0.611799999999999, 0.04274999999999862, 0.2199499999999972, 0.6460000000000016, 0.0769500000000014, 0.22850000000000037); public static final VoxelShape NORTH24 = Shapes.box(0.611799999999999, 0.29924999999999846, 0.2199499999999972, 0.6460000000000016, 0.33345000000000136, 0.22850000000000037); public static final VoxelShape NORTH25 = Shapes.box(-0.5253499999999998, 0.017100000000000004, 0.22422500000000034, 0.6716500000000004, 0.3591, 0.23277500000000018); public static final VoxelShape NORTH26 = Shapes.box(0.7528750000000004, 0.06412499999999999, 0.24559999999999915, 0.8383749999999996, 0.8763749999999999, 0.7243999999999995); public static final VoxelShape EAST = Shapes.box(0.2584999999999993, 0, -0.5723749999999996, 0.771499999999999, 0.4275, 0.7101250000000003); public static final VoxelShape EAST1 = Shapes.box(0.2969749999999993, 0, -0.7904000000000002, 0.7330249999999989, 0.3847499999999999, -0.5766500000000001); public static final VoxelShape EAST2 = Shapes.box(0.2969749999999993, 0.08549999999999996, 0.7229500000000004, 0.7330249999999989, 0.8549999999999998, 0.8682999999999996); public static final VoxelShape EAST3 = Shapes.box(0.262775, 0.08549999999999996, 0.6665199999999993, 0.7672249999999998, 0.8549999999999998, 0.7092699999999998); public static final VoxelShape EAST4 = Shapes.box(0.262775, 0.08549999999999996, -0.57152, 0.7672249999999998, 0.8549999999999998, -0.5287699999999995); public static final VoxelShape EAST5 = Shapes.box(0.30125000000000113, 0.6754500000000014, 0.6887500000000011, 0.7201999999999975, 0.8464499999999986, 0.7314999999999985); public static final VoxelShape EAST6 = Shapes.box(0.7672249999999998, 0.363375, 0.03894999999999871, 0.7757749999999997, 0.40612499999999996, 0.09879999999999911); public static final VoxelShape EAST7 = Shapes.box(0.7287499999999998, 0.18809999999999993, -0.7433750000000003, 0.7372999999999996, 0.3591, -0.6151250000000001); public static final VoxelShape EAST8 = Shapes.box(0.7330250000000005, 0.2992499999999999, -0.6963499999999991, 0.7415750000000003, 0.33345, -0.6621499999999998); public static final VoxelShape EAST9 = Shapes.box(0.7330250000000005, 0.21375, -0.6963499999999991, 0.7415750000000003, 0.2479499999999999, -0.6621499999999998); public static final VoxelShape EAST10 = Shapes.box(0.3867499999999997, 0.5984999999999998, -0.5338999999999996, 0.4295000000000002, 0.6412499999999999, 0.68875); public static final VoxelShape EAST11 = Shapes.box(0.6004999999999996, 0.5984999999999998, -0.5338999999999996, 0.6432500000000001, 0.6412499999999999, 0.68875); public static final VoxelShape EAST12 = Shapes.box(0.49362499999999954, 0.6840000000000002, -0.5338999999999996, 0.5363750000000003, 0.72675, 0.68875); public static final VoxelShape EAST13 = Shapes.box(0.7330250000000005, 0.04275000000000001, -0.7561999999999993, 0.7415750000000003, 0.07694999999999996, -0.7220000000000002); public static final VoxelShape EAST14 = Shapes.box(0.24994999999999945, 0.3847499999999999, -0.5809249999999995, 0.7800499999999988, 0.3954375, 0.7186750000000002); public static final VoxelShape EAST15 = Shapes.box(0.2584999999999993, 0.17100000000000004, -0.689937499999999, 0.30125, 0.1816875, -0.6792499999999995); public static final VoxelShape EAST16 = Shapes.box(0.13025000000000064, 0, -0.7690249999999998, 0.25850000000000084, 0.3420000000000001, -0.5980250000000005); public static final VoxelShape EAST17 = Shapes.box(0.18325999999999998, 0.06840000000000002, -0.7818499999999988, 0.20890999999999948, 0.1025999999999998, -0.7647499999999992); public static final VoxelShape EAST18 = Shapes.box(0.18325999999999998, 0.25649999999999995, -0.7818499999999988, 0.20890999999999948, 0.29069999999999974, -0.7647499999999992); public static final VoxelShape EAST19 = Shapes.box(0.16872500000000046, 0.33345, -0.7091749999999997, 0.22002500000000103, 0.3505499999999999, -0.6578749999999993); public static final VoxelShape EAST20 = Shapes.box(0.49362499999999954, 0.7694999999999999, -0.5338999999999996, 0.5363750000000003, 0.8122499999999999, 0.68875); public static final VoxelShape EAST21 = Shapes.box(0.7715000000000005, 0.04275000000000001, -0.4996999999999989, 0.7800500000000004, 0.07694999999999996, -0.4654999999999996); public static final VoxelShape EAST22 = Shapes.box(0.7715000000000005, 0.2992499999999999, -0.4996999999999989, 0.7800500000000004, 0.33345, -0.4654999999999996); public static final VoxelShape EAST23 = Shapes.box(0.7714999999999996, 0.04274999999999862, 0.611799999999999, 0.7800500000000028, 0.0769500000000014, 0.6460000000000017); public static final VoxelShape EAST24 = Shapes.box(0.7714999999999996, 0.29924999999999846, 0.611799999999999, 0.7800500000000028, 0.33345000000000136, 0.6460000000000017); public static final VoxelShape EAST25 = Shapes.box(0.7672249999999998, 0.017100000000000004, -0.5253499999999998, 0.7757749999999997, 0.3591, 0.6716500000000005); public static final VoxelShape EAST26 = Shapes.box(0.2756000000000005, 0.06412499999999999, 0.7528750000000004, 0.7544000000000008, 0.8763749999999999, 0.8383749999999996); public static final VoxelShape SOUTH = Shapes.box(0.28987499999999966, 0, 0.2584999999999993, 1.5723749999999996, 0.4275, 0.771499999999999); public static final VoxelShape SOUTH1 = Shapes.box(1.57665, 0, 0.2969749999999993, 1.7904000000000002, 0.3847499999999999, 0.7330249999999989); public static final VoxelShape SOUTH2 = Shapes.box(0.13170000000000037, 0.08549999999999996, 0.2969749999999993, 0.2770499999999997, 0.8549999999999998, 0.7330249999999989); public static final VoxelShape SOUTH3 = Shapes.box(0.29073000000000015, 0.08549999999999996, 0.262775, 0.3334800000000008, 0.8549999999999998, 0.7672249999999998); public static final VoxelShape SOUTH4 = Shapes.box(1.5287699999999995, 0.08549999999999996, 0.262775, 1.57152, 0.8549999999999998, 0.7672249999999998); public static final VoxelShape SOUTH5 = Shapes.box(0.2685000000000015, 0.6754500000000014, 0.30125000000000113, 0.3112499999999988,
0.8464499999999986, 0.7201999999999975); public static final VoxelShape SOUTH6 = Shapes.box(0.9012000000000009, 0.363375, 0.7672249999999998, 0.9610500000000013, 0.40612499999999996, 0.7757749999999997); public static final VoxelShape SOUTH7 = Shapes.box(1.6151250000000001, 0.18809999999999993, 0.7287499999999998, 1.7433750000000003, 0.3591, 0.7372999999999996); public static final VoxelShape SOUTH8 = Shapes.box(1.6621499999999998, 0.2992499999999999, 0.7330250000000005, 1.6963499999999991, 0.33345, 0.7415750000000003); public static final VoxelShape SOUTH9 = Shapes.box(1.6621499999999998, 0.21375, 0.7330250000000005, 1.6963499999999991, 0.2479499999999999, 0.7415750000000003); public static final VoxelShape SOUTH10 = Shapes.box(0.31125, 0.5984999999999998, 0.3867499999999997, 1.5338999999999996, 0.6412499999999999, 0.4295000000000002); public static final VoxelShape SOUTH11 = Shapes.box(0.31125, 0.5984999999999998, 0.6004999999999996, 1.5338999999999996, 0.6412499999999999, 0.6432500000000001); public static final VoxelShape SOUTH12 = Shapes.box(0.31125, 0.6840000000000002, 0.49362499999999954, 1.5338999999999996, 0.72675, 0.5363750000000003); public static final VoxelShape SOUTH13 = Shapes.box(1.7220000000000002, 0.04275000000000001, 0.7330250000000005, 1.7561999999999993, 0.07694999999999996, 0.7415750000000003); public static final VoxelShape SOUTH14 = Shapes.box(0.2813249999999998, 0.3847499999999999, 0.24994999999999945, 1.5809249999999995, 0.3954375, 0.7800499999999988); public static final VoxelShape SOUTH15 = Shapes.box(1.6792499999999995, 0.17100000000000004, 0.2584999999999993, 1.689937499999999, 0.1816875, 0.30125); public static final VoxelShape SOUTH16 = Shapes.box(1.5980250000000005, 0, 0.13025000000000064, 1.7690249999999998, 0.3420000000000001, 0.25850000000000084); public static final VoxelShape SOUTH17 = Shapes.box(1.7647499999999992, 0.06840000000000002, 0.18325999999999998, 1.7818499999999988, 0.1025999999999998, 0.20890999999999948); public static final VoxelShape SOUTH18 = Shapes.box(1.7647499999999992, 0.25649999999999995, 0.18325999999999998, 1.7818499999999988, 0.29069999999999974, 0.20890999999999948); public static final VoxelShape SOUTH19 = Shapes.box(1.6578749999999993, 0.33345, 0.16872500000000046, 1.7091749999999997, 0.3505499999999999, 0.22002500000000103); public static final VoxelShape SOUTH20 = Shapes.box(0.31125, 0.7694999999999999, 0.49362499999999954, 1.5338999999999996, 0.8122499999999999, 0.5363750000000003); public static final VoxelShape SOUTH21 = Shapes.box(1.4654999999999996, 0.04275000000000001, 0.7715000000000005, 1.499699999999999, 0.07694999999999996, 0.7800500000000004); public static final VoxelShape SOUTH22 = Shapes.box(1.4654999999999996, 0.2992499999999999, 0.7715000000000005, 1.499699999999999, 0.33345, 0.7800500000000004); public static final VoxelShape SOUTH23 = Shapes.box(0.3539999999999984, 0.04274999999999862, 0.7714999999999996, 0.388200000000001, 0.0769500000000014, 0.7800500000000028); public static final VoxelShape SOUTH24 = Shapes.box(0.3539999999999984, 0.29924999999999846, 0.7714999999999996, 0.388200000000001, 0.33345000000000136, 0.7800500000000028); public static final VoxelShape SOUTH25 = Shapes.box(0.3283499999999996, 0.017100000000000004, 0.7672249999999998, 1.5253499999999998, 0.3591, 0.7757749999999997); public static final VoxelShape SOUTH26 = Shapes.box(0.16162500000000035, 0.06412499999999999, 0.2756000000000005, 0.2471249999999996, 0.8763749999999999, 0.7544000000000008); public static final VoxelShape WEST = Shapes.box(0.22850000000000104, 0, 0.28987499999999966, 0.7415000000000007, 0.4275, 1.5723749999999996); public static final VoxelShape WEST1 = Shapes.box(0.2669750000000011, 0, 1.57665, 0.7030250000000007, 0.3847499999999999, 1.7904000000000002); public static final VoxelShape WEST2 = Shapes.box(0.2669750000000011, 0.08549999999999996, 0.13170000000000037, 0.7030250000000007, 0.8549999999999998, 0.2770499999999997); public static final VoxelShape WEST3 = Shapes.box(0.23277500000000018, 0.08549999999999996, 0.29073000000000015, 0.737225, 0.8549999999999998, 0.3334800000000008); public static final VoxelShape WEST4 = Shapes.box(0.23277500000000018, 0.08549999999999996, 1.5287699999999995, 0.737225, 0.8549999999999998, 1.57152); public static final VoxelShape WEST5 = Shapes.box(0.2798000000000025, 0.6754500000000014, 0.2685000000000015, 0.6987499999999989, 0.8464499999999986, 0.3112499999999988); public static final VoxelShape WEST6 = Shapes.box(0.22422500000000034, 0.363375, 0.9012000000000009, 0.23277500000000018, 0.40612499999999996, 0.9610500000000013); public static final VoxelShape WEST7 = Shapes.box(0.2627000000000004, 0.18809999999999993, 1.6151250000000001, 0.2712500000000002, 0.3591, 1.7433750000000003); public static final VoxelShape WEST8 = Shapes.box(0.2584249999999997, 0.2992499999999999, 1.6621499999999998, 0.2669749999999995, 0.33345, 1.6963499999999991); public static final VoxelShape WEST9 = Shapes.box(0.2584249999999997, 0.21375, 1.6621499999999998, 0.2669749999999995, 0.2479499999999999, 1.6963499999999991); public static final VoxelShape WEST10 = Shapes.box(0.5704999999999998, 0.5984999999999998, 0.31125, 0.6132500000000003, 0.6412499999999999, 1.5338999999999996); public static final VoxelShape WEST11 = Shapes.box(0.3567499999999999, 0.5984999999999998, 0.31125, 0.3995000000000004, 0.6412499999999999, 1.5338999999999996); public static final VoxelShape WEST12 = Shapes.box(0.46362499999999973, 0.6840000000000002, 0.31125, 0.5063750000000005, 0.72675, 1.5338999999999996); public static final VoxelShape WEST13 = Shapes.box(0.2584249999999997, 0.04275000000000001, 1.7220000000000002, 0.2669749999999995, 0.07694999999999996, 1.7561999999999993); public static final VoxelShape WEST14 = Shapes.box(0.2199500000000012, 0.3847499999999999, 0.2813249999999998, 0.7500500000000005, 0.3954375, 1.5809249999999995); public static final VoxelShape WEST15 = Shapes.box(0.69875, 0.17100000000000004, 1.6792499999999995, 0.7415000000000007, 0.1816875, 1.689937499999999); public static final VoxelShape WEST16 = Shapes.box(0.7414999999999992, 0, 1.5980250000000005, 0.8697499999999994, 0.3420000000000001, 1.7690249999999998); public static final VoxelShape WEST17 = Shapes.box(0.7910900000000005, 0.06840000000000002, 1.7647499999999992, 0.81674, 0.1025999999999998, 1.7818499999999988); public static final VoxelShape WEST18 = Shapes.box(0.7910900000000005, 0.25649999999999995, 1.7647499999999992, 0.81674, 0.29069999999999974, 1.7818499999999988); public static final VoxelShape WEST19 = Shapes.box(0.779974999999999, 0.33345, 1.6578749999999993, 0.8312749999999995, 0.3505499999999999, 1.7091749999999997); public static final VoxelShape WEST20 = Shapes.box(0.46362499999999973, 0.7694999999999999, 0.31125, 0.5063750000000005, 0.8122499999999999, 1.5338999999999996); public static final VoxelShape WESt21 = Shapes.box(0.21994999999999965, 0.04275000000000001, 1.4654999999999996, 0.22849999999999948, 0.07694999999999996, 1.499699999999999); public static final VoxelShape WEST22 = Shapes.box(0.21994999999999965, 0.2992499999999999, 1.4654999999999996, 0.22849999999999948, 0.33345, 1.499699999999999); public static final VoxelShape WEST23 = Shapes.box(0.2199499999999972, 0.04274999999999862, 0.3539999999999984, 0.22850000000000037, 0.0769500000000014, 0.388200000000001); public static final VoxelShape WEST24 = Shapes.box(0.2199499999999972, 0.29924999999999846, 0.3539999999999984, 0.22850000000000037, 0.33345000000000136, 0.388200000000001); public static final VoxelShape WEST25 = Shapes.box(0.22422500000000034, 0.017100000000000004, 0.3283499999999996, 0.23277500000000018, 0.3591, 1.5253499999999998); public static final VoxelShape WEST26 = Shapes.box(0.24559999999999915, 0.06412499999999999, 0.16162500000000035, 0.7243999999999995, 0.8763749999999999, 0.2471249999999996);
public HydraulicMetalRoller(Properties properties) { super(properties.lightLevel(state -> { return state.getValue(LIT) ? 20 : 0; })); this.registerDefaultState(this.defaultBlockState().setValue(FACING, Direction.NORTH).setValue(LIT, false)); } @Override public VoxelShape getShape(BlockState state, BlockGetter getter, BlockPos pos, CollisionContext context) { switch (state.getValue(FACING)) { case EAST: return EAST; case SOUTH: return SOUTH; case WEST: return WEST; default: return NORTH; }} @Override protected void createBlockStateDefinition(Builder<Block, BlockState> builder) { builder.add(FACING, LIT); super.createBlockStateDefinition(builder); }
@Override public BlockState getStateForPlacement(BlockPlaceContext context) { return this.defaultBlockState().setValue(FACING, context.getHorizontalDirection().getOpposite()); } @SuppressWarnings("deprecation") @Override public BlockState mirror(BlockState state, Mirror mirror) { // TODO Auto-generated method stub return state.rotate(mirror.getRotation(state.getValue(FACING))); } @Override public BlockState rotate(BlockState state, LevelAccessor level, BlockPos pos, Rotation direction) { return state.setValue(FACING, direction.rotate(state.getValue(FACING))); }
@SuppressWarnings("deprecation") @Override public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult result) { if (!world.isClientSide()) { if(player.getItemInHand(hand).getItem().equals(Items.AIR)) { world.setBlock(pos, state.cycle(LIT), 4); return InteractionResult.CONSUME; } } return super.use(state, world, pos, player, hand, result); } }