Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MajesticMadman

Members
  • Joined

  • Last visited

Everything posted by MajesticMadman

  1. Didn't get the block from McCreator, didn't even know that was a thing till I looked it up after you mentioned it. Models JSONs were made using blockbench. Blockstates were taken from minecraft assets (Though was told forges way was better, but went back to vanilla for rotation). Rotation was taken from minecrafts pumpkin. The original bounding box was got on a quick search and then modified so I could easily apply to all custom modeled blocks rather than creating a separate one for each model size.
  2. Hi, First question: I have a bounding box of 3x1 (blocks) . As far as entities go works fine, but you can only see the bounding box or destroy the block on the middle block. Is there a way like below to change the clickable hitbox: @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { return new AxisAlignedBB(westPos,topPos,northPos,eastPos,bottomPos,southPos); } Second Question: What is the best way of rotating the bounding box when placed? My idea here is that by default the bounding box is setup for the block facing north or south. If I create an IF for the direction of the block being east or west and then if true it swaps the North & South with the East & West Positions. However I'm having issues, strFacing needs to be an IBlockState, how do I get this into a value that I can compare? public String strFacing; ////////////////////////////////////////////////////////// //Handles block rotation ////////////////////////////////////////////////////////// public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) {super.onBlockAdded(worldIn, pos, state);} public IBlockState withRotation(IBlockState state, Rotation rot) { return state.withProperty(BlockHorizontal.FACING, rot.rotate((EnumFacing)state.getValue(BlockHorizontal.FACING))); } public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return this.getDefaultState().withProperty(BlockHorizontal.FACING, placer.getHorizontalFacing().getOpposite()); strFacing = this.getDefaultState().withProperty(BlockHorizontal.FACING, placer.getHorizontalFacing().getOpposite()); } public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.getHorizontal(meta)); } public int getMetaFromState(IBlockState state) { return ((EnumFacing)state.getValue(BlockHorizontal.FACING)).getHorizontalIndex(); } protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] {BlockHorizontal.FACING}); } ////////////////////////////////////////////////////////// //Sets hitbox ////////////////////////////////////////////////////////// @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { if(strFacing == "East" || strFacing == "West") { northPosHolder = northPos; southPosHolder = southPos; northPos = eastPos; southPos = westPos; eastPos = northPosHolder; westPos = southPosHolder; } return new AxisAlignedBB(westPos,topPos,northPos,eastPos,bottomPos,southPos); } }
  3. Yes, but as there are going to be a lot of items/blocks within the file trees so models>blocks would be the parent. Them every block would be separated into a different category at this level, and the a sub category and potentially more subs dependent on the block. So I was trying to find a way to do it in the JSON which would be simpler than having to create a variable for each block and within that set the file path and then reference that in the ModelResourceLocation
  4. This should now be fixed. I though it would be wise that I can edit BlockBase and it take those into account in future uses when I did it, though it may not ever be used the idea was more just in case. I'm aware that the item blockstate doesn't exist, just wanted to make sure nothing was missed. But thanks for confirming that's all it is. Yeah, it's working now thanks. Just didn't check over what I had done well enough apparently. I've now fixed that up. Thanks for the help.
  5. Hi, I know this has been asked 1000s of times, but I couldn't find the answer to what's wrong with my block. So the block in game displays the model and texture fine. But doesn't actually change which way it's facing. Using the Pumpkin as reference I created the block class: package madman.lonelytraveller.objects.objectclasses; import madman.lonelytraveller.Main; import net.minecraft.block.Block; import net.minecraft.block.BlockHorizontal; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.util.EnumFacing; import net.minecraft.util.Rotation; public class BlockBaseNotCubeRotate extends BlockBase { public BlockBaseNotCubeRotate(Material material, String name) { super(material,name); this.setDefaultState(this.blockState.getBaseState().withProperty(BlockHorizontal.FACING, EnumFacing.NORTH)); } @Override @Deprecated public boolean isOpaqueCube(IBlockState state) { return false; } @Override @Deprecated public boolean isFullCube(IBlockState state) { return false; } public IBlockState withRotation(IBlockState state, Rotation rot) { return state.withProperty(BlockHorizontal.FACING, rot.rotate((EnumFacing)state.getValue(BlockHorizontal.FACING))); } public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(BlockHorizontal.FACING, EnumFacing.getHorizontal(meta)); } public int getMetaFromState(IBlockState state) { return ((EnumFacing)state.getValue(BlockHorizontal.FACING)).getHorizontalIndex(); } protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] {BlockHorizontal.FACING}); } } And them my blockstate file is: { "forge_marker": 1, "variants": { "facing=north": { "model": "dw_lonelytraveller:gallifrey_chair_council" }, "facing=east": { "model": "dw_lonelytraveller:gallifrey_chair_council", "y": 90 }, "facing=south": { "model": "dw_lonelytraveller:gallifrey_chair_council", "y": 180 }, "facing=west": { "model": "dw_lonelytraveller:gallifrey_chair_council", "y": 270 }, "inventory": { "model": "dw_lonelytraveller:gallifrey_chair_council" } } } The Console Output *I know there isn't an Item Blockstate yet. :
  6. Hi, I'm having problems getting a block to get its custom model in world and in inventory. The below line is the only thing I can see that indicates where its going wrong, but I don't know what it's expecting differently: Line from console: Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Invalid escape sequence at line 5 column 53 path $.variants.. This is the console with errors: My blockstate is located "src\main\resources\assets\dw_lonelytraveller\blockstates\gallifrey_chair_council.json" and contains: { "forge_marker": 1, "variants": { "normal": { "model": "dw_lonelytraveller:Gallifrey\council_chamber\gallifrey_chair_council" }, "inventory": { "model": "dw_lonelytraveller:Gallifrey\council_chamber\gallifrey_chair_council" } } } My Model is located "src\main\resources\assets\dw_lonelytraveller\models\block\Gallifrey\council_chamber\gallifrey_chair_council.json" and contains (The lack of textures is intentional right now): { "elements": [ { "name": "LegFL", "from": [1, 0, 1], "to": [2, 19, 2], "faces": { "north": {"uv": [0, 0, 1, 14], "texture": "#missing"}, "east": {"uv": [0, 0, 1, 14], "texture": "#missing"}, "south": {"uv": [0, 0, 1, 14], "texture": "#missing"}, "west": {"uv": [0, 0, 1, 14], "texture": "#missing"}, "up": {"uv": [0, 0, 1, 1], "texture": "#missing"}, "down": {"uv": [0, 0, 1, 1], "texture": "#missing"} } }, { "name": "LegFR", "from": [14, 0, 1], "to": [15, 19, 2], "faces": { "north": {"uv": [0, 0, 1, 14], "texture": "#missing"}, "east": {"uv": [0, 0, 1, 14], "texture": "#missing"}, "south": {"uv": [0, 0, 1, 14], "texture": "#missing"}, "west": {"uv": [0, 0, 1, 14], "texture": "#missing"}, "up": {"uv": [0, 0, 1, 1], "texture": "#missing"}, "down": {"uv": [0, 0, 1, 1], "texture": "#missing"} } }, { "name": "LegRL", "from": [1, 0, 14], "to": [2, 32, 15], "faces": { "north": {"uv": [0, 0, 1, 16], "texture": "#missing"}, "east": {"uv": [0, 0, 1, 16], "texture": "#missing"}, "south": {"uv": [0, 0, 1, 16], "texture": "#missing"}, "west": {"uv": [0, 0, 1, 16], "texture": "#missing"}, "up": {"uv": [0, 0, 1, 1], "texture": "#missing"}, "down": {"uv": [0, 0, 1, 1], "texture": "#missing"} } }, { "name": "LegRR", "from": [14, 0, 14], "to": [15, 32, 15], "faces": { "north": {"uv": [0, 0, 1, 16], "texture": "#missing"}, "east": {"uv": [0, 0, 1, 16], "texture": "#missing"}, "south": {"uv": [0, 0, 1, 16], "texture": "#missing"}, "west": {"uv": [0, 0, 1, 16], "texture": "#missing"}, "up": {"uv": [0, 0, 1, 1], "texture": "#missing"}, "down": {"uv": [0, 0, 1, 1], "texture": "#missing"} } }, { "name": "ChairBase", "from": [2, 10, 2], "to": [14, 14, 14], "faces": { "north": {"uv": [0, 0, 12, 4], "texture": "#missing"}, "east": {"uv": [0, 0, 12, 4], "texture": "#missing"}, "south": {"uv": [0, 0, 12, 4], "texture": "#missing"}, "west": {"uv": [0, 0, 12, 4], "texture": "#missing"}, "up": {"uv": [0, 0, 12, 12], "texture": "#missing"}, "down": {"uv": [0, 0, 12, 12], "texture": "#missing"} } }, { "name": "ChairBack", "from": [6, 6, 14], "to": [10, 25, 15], "faces": { "north": {"uv": [0, 0, 4, 16], "texture": "#missing"}, "east": {"uv": [0, 0, 1, 16], "texture": "#missing"}, "south": {"uv": [0, 0, 4, 16], "texture": "#missing"}, "west": {"uv": [0, 0, 1, 16], "texture": "#missing"}, "up": {"uv": [0, 0, 4, 1], "texture": "#missing"}, "down": {"uv": [0, 0, 4, 1], "texture": "#missing"} } }, { "name": "BraceBack", "from": [2, 4, 14], "to": [15, 6, 15], "faces": { "north": {"uv": [0, 0, 13, 2], "texture": "#missing"}, "east": {"uv": [0, 0, 1, 2], "texture": "#missing"}, "south": {"uv": [0, 0, 13, 2], "texture": "#missing"}, "west": {"uv": [0, 0, 1, 2], "texture": "#missing"}, "up": {"uv": [0, 0, 13, 1], "texture": "#missing"}, "down": {"uv": [0, 0, 13, 1], "texture": "#missing"} } }, { "name": "BraceLeft", "from": [1, 4, 2], "to": [2, 6, 14], "faces": { "north": {"uv": [0, 0, 1, 2], "texture": "#missing"}, "east": {"uv": [0, 0, 12, 2], "texture": "#missing"}, "south": {"uv": [0, 0, 1, 2], "texture": "#missing"}, "west": {"uv": [0, 0, 12, 2], "texture": "#missing"}, "up": {"uv": [0, 0, 1, 12], "texture": "#missing"}, "down": {"uv": [0, 0, 1, 12], "texture": "#missing"} } }, { "name": "BraceRight", "from": [14, 4, 2], "to": [15, 6, 14], "faces": { "north": {"uv": [0, 0, 1, 2], "texture": "#missing"}, "east": {"uv": [0, 0, 12, 2], "texture": "#missing"}, "south": {"uv": [0, 0, 1, 2], "texture": "#missing"}, "west": {"uv": [0, 0, 12, 2], "texture": "#missing"}, "up": {"uv": [0, 0, 1, 12], "texture": "#missing"}, "down": {"uv": [0, 0, 1, 12], "texture": "#missing"} } }, { "from": [2, 26, 14], "to": [14, 30, 15], "faces": { "north": {"uv": [0, 0, 10, 4], "texture": "#missing"}, "east": {"uv": [0, 0, 1, 4], "texture": "#missing"}, "south": {"uv": [0, 0, 10, 4], "texture": "#missing"}, "west": {"uv": [0, 0, 1, 4], "texture": "#missing"}, "up": {"uv": [0, 0, 10, 1], "texture": "#missing"}, "down": {"uv": [0, 0, 10, 1], "texture": "#missing"} } }, { "from": [3, 30, 14], "to": [13, 31, 15], "faces": { "north": {"uv": [0, 0, 10, 4], "texture": "#missing"}, "east": {"uv": [0, 0, 1, 4], "texture": "#missing"}, "south": {"uv": [0, 0, 10, 4], "texture": "#missing"}, "west": {"uv": [0, 0, 1, 4], "texture": "#missing"}, "up": {"uv": [0, 0, 10, 1], "texture": "#missing"}, "down": {"uv": [0, 0, 10, 1], "texture": "#missing"} } }, { "from": [3, 25, 14], "to": [13, 26, 15], "faces": { "north": {"uv": [0, 0, 10, 4], "texture": "#missing"}, "east": {"uv": [0, 0, 1, 4], "texture": "#missing"}, "south": {"uv": [0, 0, 10, 4], "texture": "#missing"}, "west": {"uv": [0, 0, 1, 4], "texture": "#missing"}, "up": {"uv": [0, 0, 10, 1], "texture": "#missing"}, "down": {"uv": [0, 0, 10, 1], "texture": "#missing"} } }, { "name": "ArmLef", "from": [14, 18, 2], "to": [15, 19, 14], "faces": { "north": {"uv": [0, 0, 1, 2], "texture": "#missing"}, "east": {"uv": [0, 0, 12, 2], "texture": "#missing"}, "south": {"uv": [0, 0, 1, 2], "texture": "#missing"}, "west": {"uv": [0, 0, 12, 2], "texture": "#missing"}, "up": {"uv": [0, 0, 1, 12], "texture": "#missing"}, "down": {"uv": [0, 0, 1, 12], "texture": "#missing"} } }, { "name": "ArmRight", "from": [1, 18, 2], "to": [2, 19, 14], "faces": { "north": {"uv": [0, 0, 1, 2], "texture": "#missing"}, "east": {"uv": [0, 0, 12, 2], "texture": "#missing"}, "south": {"uv": [0, 0, 1, 2], "texture": "#missing"}, "west": {"uv": [0, 0, 12, 2], "texture": "#missing"}, "up": {"uv": [0, 0, 1, 12], "texture": "#missing"}, "down": {"uv": [0, 0, 1, 12], "texture": "#missing"} } } ], "display": { "thirdperson_righthand": { "scale": [0.3, 0.3, 0.3], "rotation": [0, 146, 0] }, "gui": { "scale": [0.4, 0.4, 0.4], "rotation": [12, 155, 0], "translation": [0, -3.5, 0] }, "fixed": { "scale": [0, 0.65, 0.1], "translation": [0, -4.5, -1] }, "ground": { "scale": [0.3, 0.3, 0.3] }, "firstperson_lefthand": { "scale": [0.3, 0.3, 0.3], "rotation": [0, 118, 0], "translation": [0, 0, 2.5] }, "firstperson_righthand": { "scale": [0.3, 0.3, 0.3], "translation": [0, 0, 2.5], "rotation": [0, 118, 0] }, "thirdperson_lefthand": { "scale": [0.3, 0.3, 0.3], "rotation": [0, 146, 0] } }, "groups": [0, 1, 2, 3, 4, 5, 6, 7, 8, { "name": "HeadRest", "isOpen": true, "export": true, "visibility": true, "children": [9, 10, 11] }, 12, 13] }
  7. *Logs at the end* Hi, So I've been running a small server with only two people accessing it building a map, everything was working fine till one day I log on, and the 2nd layer of my skin was missing. I then tried to test one of the door systems (Use a testfor nearby player and scoreboard value to clone blocks and play sound and displays a title, non of which worked. So I tried swapping gamemode which also didn't work as well as interacting with any block (crafting table, furnace etc.) before the server just stopped (Required confirmation before it shutdown). So I rebuilt the entire server using the latest version of forge available for 1.10.2, after walking around for no more that 2 mins the server gave out the same message ( see CMD/Server Output below) So I got the other guy to try it and again could walk around close to the start of the map (Isn't the same place as spawn) and then the same error occurs. Nothing has changed between it working and crashing, and have checked that the other person hadn't been on in that time. Appreciate any help in determining the cause or a way to fix Thanks, Mod List: Crash Log: CMD/Server Output:

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.