
Daniel Rollins
Members-
Content Count
14 -
Joined
-
Last visited
Community Reputation
0 NeutralAbout Daniel Rollins
-
Rank
Tree Puncher
-
Daniel Rollins started following [1.13.2] Set block harvest level and tool without overriding functions, [1.14.4] Custom signs, 1.14.4 Trouble getting BlockState and and 2 others
-
Hi, I am trying to make a custom sign but it isn't working. I'm not really trying to make a fully custom sign, I just want to have a new additional sign that uses a different texture but behaves the same as the regular signs. (I don't want to override the textures of the regular signs because I want them too). The 2 problems I have with my sign are: 1. No texture (not sure where the texture for signs is declared but blockstate and model jsons do not have them and I haven't been able to find them in code), 2. When placing the sign, it doesn't open the sign GUI. The way I coded it was as follows: Registered blocks: MyBlocks.metal_sign = new StandingSignBlock(Block.Properties.create(Material.WOOD).doesNotBlockMovement().hardnessAndResistance(1.0F).sound(SoundType.WOOD)).setRegistryName(location("metal_sign")), MyBlocks.metal_wall_sign = new WallSignBlock(Block.Properties.create(Material.WOOD).doesNotBlockMovement().hardnessAndResistance(1.0F).sound(SoundType.WOOD)).setRegistryName(location("metal_wall_sign")) Registered item: MyItems.metal_sign = new SignItem((new Item.Properties()).maxStackSize(16).group(ItemGroup.DECORATIONS), MyBlocks.metal_sign, MyBlocks.metal_wall_sign).setRegistryName(MyBlocks.metal_sign.getRegistryName()) Created blockstate json for metal_sign & metal_wall_sign, created model json for metal_sign (I did this exactly like how acacia signs, oak signs, etc are done), created model item json as well. I found the sign textures in textures/entities/signs and tried putting mine in the same folder (both under minecraft and under my mod's folder), but that didn't help. I get no errors in the debug log so I'm really confused why this isn't working. I did verify (using data get block) that my invisible sign does have a tile entity of the right type. Any help would be appreciated. Thanks
-
1.14.4 Trouble getting BlockState
Daniel Rollins replied to Daniel Rollins's topic in Modder Support
Is there a place I could see the error? It didn't show up in the debug log. -
1.14.4 Trouble getting BlockState
Daniel Rollins replied to Daniel Rollins's topic in Modder Support
Never mind, I figured it out. That particular block doesn't have a FACING property, it has a HORIZONTAL_FACING property. Use the right one and the code works. -
1.14.4 Trouble getting BlockState
Daniel Rollins replied to Daniel Rollins's topic in Modder Support
Sorry, I should have been more clear. The game doesn't crash, the command dies midway through. I added logger commands and can tell that it stops functioning at the exact statement above. I also get "An unexpected error occurred trying to execute that command" in the chat window and in the log. -
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.
-
Hi, I have a GUI that extends Screen. It is similar to how a writable_book works. There is not a container and no tileentity. The Gui pulls data from NBT from the Item and uses a network handler to send the data to the server. The Gui comes up from an Item by using onItemRightClick. I currently call it from that function like this: Minecraft.getInstance().displayGuiScreen(new MyGuiScreen(playerIn, itemstack, handIn)); That has been working fine until I put my mod on a Dedicated Server and got this error at startup: "Attempted to load class net/minecraft/client/gui/screen/Screen for invalid dist DEDICATED_SERVER". How do I call my Gui properly in 1.14.4 so it doesn't crash the server? I saw some posts that suggested other things like NetworkHooks but those all seemed to require tile entities or containers. Thank you for your help.
-
Modded Blocks from upgraded world missing
Daniel Rollins replied to Daniel Rollins's topic in Modder Support
Thank you, I'll look into that. -
Modded Blocks from upgraded world missing
Daniel Rollins replied to Daniel Rollins's topic in Modder Support
Thank you everyone for your help. One more question: Is it possible to edit the actual Minecraft base code? It seems to be read-only in Eclipse. I found the part of the code where it does the block renames using the data fixer upper. If I could just add several additional lines of code to the function I think I could have it take care of my blocks as well. It seems like such a simple fix if I could just edit it, otherwise I'm not sure how to do it. -
Modded Blocks from upgraded world missing
Daniel Rollins replied to Daniel Rollins's topic in Modder Support
So basically at the moment we can't bring over a modded world from 1.12.2 to 1.13 or 1.14? All we can do it get our mod ready for the new version and build everything in the world from scratch or wait for the new DataFixer system? What about that missingMapping thing. Would that help? -
Hi, I hope someone can point me in the right direction. I built a mod in 1.12.2 with lots of custom blocks which I used to build things in the world. I now have the mod working in 1.14.4 (and even in 1.13.2 along the way). The problem is that when I load one of my 1.12.2 worlds in 1.13.2 or in 1.14.4, all my custom blocks are gone from the world. I have them in the inventory so I can use them and I kept all the same names, but all my stuff only has the vanilla blocks. The custom blocks are just gone from anything I built. Is there something I'm missing? I figured keeping the block names the same would have converted them to the new version. Is there something else I need to do? Note: Some of the blocks are really simple, some have a few properties like powered and direction, and a few have tile entities. Thank you for any help you can give.
-
Hi, I am making a custom command that included an EntityArgument but I don't want to actually parse that argument into entities. My custom command is like a custom teleport command that figures out the destination and then calls the real teleport command with the same source EntityArgument and the destination that my command figures out. I don't to just grab a string because I won't have the suggestions and validation that I normally get when using EntityArgument but I can't pass the parsed entities to the real teleport command as far as I know. Is there something I'm missing here? How can I get the raw string that was typed into the EntityArgument rather than the parsed version, or is there a better way to do this? In 1.12.2 I just kept that particular argument and passed it to the teleport command along with my generated destination. Thanks
-
Thank you for your reply. If I have to create more classes then I guess I have to but I was wondering if there was anything I could do with this (found in Block Class): static { net.minecraftforge.common.ForgeHooks.setBlockToolSetter((block, tool, level) -> { block.harvestTool = tool; block.harvestLevel = level; }); I'm not super great with Java yet so I'm not sure how I would use this or if it would be easier to just create the extra classes. Thanks
-
Hi, is there a way to set the block harvest level and tool without having to override the getHarvestTool and getHarvestLevel functions? Basically, how can I set the internal harvestTool and harvestLevel variables? Preferably I would like to be able to set them without putting them in the custom block classes. In my mod I tried to have less actual block classes by basically doing this: BlockList.new_block1 = new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(20.0F, 27.0F).lightValue(0).sound(SoundType.METAL)).setRegistryName(location("new_block1")) # Using vanilla block class BlockList.new_block2 = new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(5.0F, 3.0F).lightValue(0).sound(SoundType.METAL)).setRegistryName(location("new_block2")) # Using vanilla block class or BlockList.custom_block1 = new CustomBlock(Block.Properties.create(Material.IRON).hardnessAndResistance(5.0F, 1.0F).lightValue(15).sound(SoundType.GLASS)).setRegistryName(location("custom_block1")) # Using custom block class BlockList.custom_block2= new CustomBlock(Block.Properties.create(Material.IRON).hardnessAndResistance(30.0F, 15.0F).lightValue(0).sound(SoundType.GLASS)).setRegistryName(location("custom_block2")) # Using same custom block class Is there a way to set the harvest info similar to how I set the hardness and resistance so I don't have to create custom classes just for different harvest settings? Thanks