Posted April 22, 201510 yr Hello, I do not know if this is normal, when I put number (in the game) to fly speed, brand myself it to change, but I am forced to restart the world. For the speed, i don't need reload world. Is this normal? A there a solution? My code : package com.BlockU.blocks.command; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; import net.minecraft.world.WorldSettings.GameType; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; public class CommandFlySpeed extends CommandBase{ @Override public String getName() { return "Fly"; } @Override public String getCommandUsage(ICommandSender sender) { return "/Fly"; } @Override public void execute(ICommandSender sender, String[] args) throws CommandException { if (args.length < 2) { EntityPlayer player = (EntityPlayer) sender; String str = args[0]; int i = Integer.parseInt(str); Integer a = Integer.valueOf(str); player.capabilities.setFlySpeed(a); player.setSprinting(true); player.addChatMessage(new ChatComponentText (EnumChatFormatting.GREEN + "La vitesse de vol a été augementé de" + args[0])); } else{ sender.addChatMessage(new ChatComponentText (EnumChatFormatting.RED + "Erreur")); } } } Thank you for your help Ps: Thanks diesieben07, I managed with Args D
April 23, 201510 yr What do you mean that it forces you to reload the world? Does it crash, or does it come up with a message, or do you mean nothing happens until the next time you load the world? Check out my tutorials here: http://jabelarminecraft.blogspot.com/
April 24, 201510 yr Author I need leave my solo game or server, and reconnect for the fly speed take the change.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.