Jump to content

Natank25

Members
  • Posts

    10
  • Joined

  • Last visited

Converted

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Natank25's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Does anyone have an idea ? Or is it just a useless feature that no one knows ?
  2. Hi, As the title says, i need help with the function getShapeForEachState. I want to create a sliding door and to do that, i created a block with a custom integer property named frame. I then wanted to use this function to get the shape for every frame and direction but I don't know how to use the function. I also tried to use BlockEntity to do a smooth animation but 2 blocks entities animation seems hard to synchronise. Can anyone help me with this or help me create a proper block entity ?
  3. How do i do this ?
  4. The code of vanilla commands ?
  5. And how do I "connect" .executes() to builder.then() ?
  6. True, i modified it from Commands.argument("player", EntityArgument.player()) to Commands.argument("null", null) to remove the argument and it didn't worked (Do you have any ideas on how to do it ?). I tried to launch minecraft again, and it work, thank you for your help
  7. Because i don't know how to do git repo, i send the Command class SwitchDimCommand: package io.github.Natank25.customdim.commom.command.impl; import com.mojang.brigadier.Command; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import io.github.Natank25.customdim.commom.command.BaseCommand; import io.github.Natank25.customdim.core.init.DimensionInit; import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; import net.minecraft.command.arguments.EntityArgument; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.world.World; public class SwitchDimCommand extends BaseCommand { public SwitchDimCommand(String name, int permissionLevel, boolean enabled) { super(name, permissionLevel, enabled); } @Override public LiteralArgumentBuilder<CommandSource> setExecution() { return builder.then(Commands.argument("null", null) .executes(source -> execute(source.getSource(), EntityArgument.getPlayer(source, "player")))); } private int execute(CommandSource source, ServerPlayerEntity player) { if (source.getLevel() == source.getServer().getLevel(World.OVERWORLD)) { player.teleportTo(source.getServer().getLevel(DimensionInit.EMPTY_DIM),0,4,0,0,0); } else if (source.getLevel() == source.getServer().getLevel(DimensionInit.EMPTY_DIM)) { player.teleportTo(source.getServer().getLevel(World.OVERWORLD),-268,76,276,0,0); } return Command.SINGLE_SUCCESS; } } BaseCommand: package io.github.Natank25.customdim.commom.command; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; public class BaseCommand { protected LiteralArgumentBuilder<CommandSource> builder; boolean enabled; public BaseCommand(String name, int permissionLevel, boolean enabled) { this.builder = Commands.literal(name).requires(source -> source.hasPermission(permissionLevel)); this.enabled = enabled; } public LiteralArgumentBuilder<CommandSource> getBuilder() { return builder; } public boolean isEnabled() { return enabled; } public LiteralArgumentBuilder<CommandSource> setExecution() { return null; } }
  8. The whole code or just the command class ?
  9. Minecraft crashes each time I load into a world already created or not. Does anyone has an idea on how to fix this ? This is my crash log :
×
×
  • Create New...

Important Information

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