Jump to content

Recommended Posts

Posted

If you have the same problem then change it to this:

@Override

public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {

if (sender instanceof EntityPlayer) {

EntityPlayer player = (EntityPlayer) sender;

Style red = new Style().setColor(TextFormatting.DARK_RED);

player.addChatComponentMessage(new TextComponentTranslation("commands.mm.name").setStyle(red));

}

}

 

 

 

 

I can't use coulour codes in lang, am I doing something wrong?

commands.mm.name=§1Name: MCrafterzz Mod

 

public class CommandMCrafterzzMod extends CommandBase {

 

public CommandMCrafterzzMod() {

 

}

 

@Override

public String getCommandName() {

return "mcrafterzzmod";

}

 

@Override

public String getCommandUsage(ICommandSender sender) {

return "mcrafterzzmod";

}

 

@Override

public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {

if (sender instanceof EntityPlayer) {

EntityPlayer player = (EntityPlayer) sender;

player.addChatComponentMessage(new TextComponentTranslation("commands.mm.name"));

player.addChatComponentMessage(new TextComponentTranslation("commands.mm.modid"));

player.addChatComponentMessage(new TextComponentTranslation("commands.mm.version"));

player.addChatComponentMessage(new TextComponentTranslation("commands.mm.minecraftversion"));

player.addChatComponentMessage(new TextComponentTranslation("commands.mm.creator"));

player.addChatComponentMessage(new TextComponentTranslation("commands.mm.updatepage"));

}

}

 

@Override

public boolean checkPermission(MinecraftServer server, ICommandSender sender) {

return true;

}

 

@Override

public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args,

BlockPos pos) {

return null;

}

 

}

Posted

I know what casts do it converts it to what your casting and I thought that would work because it wants a textcomponent. I didn't know that you should have done it on a new line. Now you have learned me so I won't make this mistake again. I have only made minecraft mods for a couple of weeks so I don't know how to do everything.  Thank you for your reply

  • 3 weeks later...
Posted

Is it more correct to implement ICommand rather than extend CommandBase for this type of command? When would one not choose ICommand?

 

 

 

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • @TileEntity it seemed to work, but do you know of a way i could get the two mods to play nicely with each other? Im just trying to add supplementary to a modpack (and most of the mods dont play nicely with neoforge) so i cant exactly remake the whole pack.
    • I did that and it says Error: Unable to access jarfile server.jar im assuming this is why you said make to sure they match? so I checked and following that same path then viewing the server folder, there is no .far file only a .dll file checking the modded server folder obviously has a server-1.20.1.jar file though completely different pathing so I don't think this is what you mean but let me know if im missing something. ALSO, was probably not what was needed but I reinstalled Java 17 in case it didnt fully download for some reason? still no such file.
    • Yes - Update 6 makes larger changes which is breaking these addons Most addons already have the update - some are still in the update process and will be released in the next days
    • So, as I understand it, at the moment it's not possible to update the modpack because too few addons are compatible with version 6 of Create?
    • Check the PC for the Java 17 installation The Oracle Java default path is C:\Program Files\Java\jdk-17\bin\javaw.exe   Open the bat file and replace the world java with the path and put it into quotation marks "C:\Program Files\Java\jdk-17\bin\javaw.exe" -Xmx4G -jar server.jar pause Make sure the java path is correct - the server jar file name also have to match
  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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