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.

CrativeMan

Members
  • Joined

  • Last visited

Everything posted by CrativeMan

  1. I want to check if my coordinates are air and if thtats the case set a boolean to true. How can I do that. public static double lX; public static double lY; public static double lZ; These are the coordinates.
  2. package de.sebastian.tutorial.block.custom; import com.mojang.realmsclient.util.WorldGenerationInfo; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; import org.jetbrains.annotations.Nullable; import java.util.Optional; public class TeleporterBlock extends Block { public long requiredXl; public long requiredYl; public long requiredZl; public double requiredXd; public double requiredYd; public double requiredZd; @Override public Optional<Vec3> getRespawnPosition(BlockState state, EntityType<?> type, LevelReader levelReader, BlockPos pos, float orientation, @Nullable LivingEntity entity) { return super.getRespawnPosition(state, type, levelReader, pos, orientation, entity); } String failed = "To low on levels"; @Override public InteractionResult use(BlockState state, Level level, BlockPos blockPos, Player player, InteractionHand interactionHand, BlockHitResult blockHitResult) { if(!level.isClientSide && interactionHand == InteractionHand.MAIN_HAND){ if(player.experienceLevel > 1){ player.giveExperienceLevels(-1); // player.teleportTo(); } else { player.sendSystemMessage(Component.nullToEmpty(failed)); } } return super.use(state, level, blockPos, player, interactionHand, blockHitResult); } public TeleporterBlock(Properties properties) { super(properties); } } This is my code. I am a bit lost on what to do with your response
  3. with the output of the getRespawnPosition public Optional<Vec3> getRespawnPosition(BlockState state, EntityType<?> type, LevelReader levelReader, BlockPos pos, float orientation, @Nullable LivingEntity entity) { return super.getRespawnPosition(state, type, levelReader, pos, orientation, entity); } I want to teleport the player to that location
  4. and how can i use the data
  5. I want to get a Players respawn location in doubles. How can I do that.

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.