Everything posted by BliX5
-
[1.16] Make a blockstate for a block
Thanks for the help! I just realized my mistake: for some reason, in the block.json file, if I insert a space between two attributes, it doesn't recognize the second one. I fixed it, and now my block works perfectly
-
[1.16] Make a blockstate for a block
I've searched through videos and websites, as well as the forge docs, but I can't find how to properly add a custom blockstate to my custom-modeled block. I'm trying to change the texture of the block whenever I right click it, but nothing I add in seems to work correctly. I keep getting the correct hitbox, but no model or texture is recognized. What is the proper way to do this for the newest version?
-
Identify block next to player 1.16
Nevermind, I'm dumb. It's fixed now. Thanks for the help!
-
Identify block next to player 1.16
I tested it and the code tracks all entities, not just the player. How can I make LivingJumpEvent only track the player?
-
Identify block next to player 1.16
@Mod.EventBusSubscriber(modid = main.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class ModClientEvents { @SubscribeEvent public static void onJumpNearStone(LivingEvent.LivingJumpEvent event) { LivingEntity player = event.getEntityLiving(); World world = player.getEntityWorld(); BlockPos pos = player.func_233580_cy_(); if (world.getBlockState(pos.add(1, 0, 0)).getBlock() == Blocks.STONE) { main.LOGGER.info(pos.add(1, 0, 0)); } else if (world.getBlockState(pos.add(-1, 0, 0)).getBlock() == Blocks.STONE) { main.LOGGER.info(pos.add(-1, 0, 0)); } else if (world.getBlockState(pos.add(0, 0, 1)).getBlock() == Blocks.STONE) { main.LOGGER.info(pos.add(0, 0, 1)); } else if (world.getBlockState(pos.add(0, 0, -1)).getBlock() == Blocks.STONE) { main.LOGGER.info(pos.add(0, 0, -1)); } } } It's probably very inefficient, but it works (mostly). My only problem is I must've messed up some code with the player, so instead of tracking only the player, it tracks every entity. I noticed this when I kept getting random messages when I wasn't jumping, but turning off mob spawning fixed the issue. Help?
-
Identify block next to player 1.16
How would I use BlockPos.offset to find a Block value?
-
Identify block next to player 1.16
New to modding, and I'm trying to make a climbing feature, so if you jump next to a certain block, you'll start climbing. The problem is: I don't know how to identify a block next to a player, only directly under. Any help would be appreciated. Thanks in advance.