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.

Leaderboard

Popular Content

Showing content with the highest reputation on 10/30/18 in all areas

  1. This is indeed correct. With the way you are assigning values to the fields you don't need the ObjectHolder annotation though. I would say that using ObjectHolders to obtain references to your blocks is preferred though in case you need to compare the blocks at some point. So instead of assigning values to static fields in the registry event just register your blocks and let the object holders do the job for you like I do here and here.
  2. if you are looking for simple rotation, then stairs may not be the best example. Stairs rotate, but also can be placed upside down and their bounding boxes change. 1) add property facing to your block public static final PropertyDirection FACING = BlockHorizontal.FACING; 2) set default blockstate in the block constructor this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); 3) create the proper blockstatecontainer @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] { FACING}); } 4) meta-> blockstate and blockstate->meta. a meta value is store with each blockstate. you have to convert this to and from the blockstate property value (below is taken from one of my blocks with other properties removed manually without testing, but think it is ok) @Override public IBlockState getStateFromMeta(int meta) { EnumFacing enumfacing = EnumFacing.getFront(meta); if (enumfacing.getAxis() == EnumFacing.Axis.Y) { enumfacing = EnumFacing.NORTH; } return this.getDefaultState().withProperty(FACING, enumfacing); } @Override public int getMetaFromState(IBlockState state) { EnumFacing facing=state.getValue(FACING); int meta=((EnumFacing)state.getValue(FACING)).getIndex(); return meta; } 5)set the property values in the blockstate json. (the "mod" is your modid, the "model" is your model json which should be located in assets/[mod]/models/block. If you wanted different models for different directions, just change here. { "variants": { "facing=north": { "model": "mod:model" }, "facing=east": { "model": "mod:model", "y": 90 }, "facing=south": { "model": "mod:model", "y": 180 }, "facing=west": { "model": "mod:model", "y": 270 }, } } I think that is all you need. Good luck. Don't get discouraged modding, once you get used to looking into the minecraft code, it gets easier.

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.