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.

Alexanderqwerty

Members
  • Joined

  • Last visited

  1. @Override public ActionResultType use(BlockState state, World world, BlockPos pos, PlayerEntity playerEntity, Hand hand, BlockRayTraceResult result) { state = state.cycle(LOCKED); world.setBlock(pos, state, 10); return ActionResultType.sidedSuccess(world.isClientSide); } i change code to this and its work
  2. Im trying to change model in code like that @Override public ActionResultType use(BlockState state, World world, BlockPos pos, PlayerEntity playerEntity, Hand hand, BlockRayTraceResult result) { if (state.getValue(LOCKED)) { world.setBlock(pos, state.setValue(LOCKED, false), 3); System.out.println("unlocked"); } else { world.setBlock(pos, state.setValue(LOCKED, true), 3); System.out.println("locked"); } return ActionResultType.PASS; } { "variants": { "locked=true": { "model": "sovietmod:block/vinyl_record_player" }, "locked=false": { "model": "sovietmod:block/vinyl_record_player2" } } } But when i click. Block twice change its model. [17:47:12] [Server thread/INFO] [STDOUT/]: [com.Soviet.sovietmod.block.custom.VinylRecordPlayer:use:60]: locked [17:47:12] [Server thread/INFO] [STDOUT/]: [com.Soviet.sovietmod.block.custom.VinylRecordPlayer:use:57]: unlocked

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.