Jump to content

CrativeMan

Members
  • Posts

    6
  • Joined

  • Last visited

CrativeMan's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  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.
×
×
  • Create New...

Important Information

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