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.

Ottoguy

Members
  • Joined

  • Last visited

  1. I want a command to be accessible by all players on a server as well as in single player. But I only manage to use the command if I'm an OP or allow a local server to use cheats. Could you help me out here? The code in my command class: package com.ottoguy.pointsmodmain.command; import net.minecraft.block.Block; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.world.World; import net.minecraftforge.client.IClientCommand; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.server.permission.PermissionAPI; public class CommandChooseTeam extends CommandBase{ @Override public String getName() { // TODO Auto-generated method stub return "points"; } @Override public String getUsage(ICommandSender sender) { // TODO Auto-generated method stub return "Used for choosing team in points mod"; } @Override public int getRequiredPermissionLevel() { return 0; } @Override public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { World world = sender.getEntityWorld(); if (world.isRemote) { System.out.println("Processing on the client side"); }else { System.out.println("Processing on the server side"); EntityPlayerMP player = getCommandSenderAsPlayer(sender); if(args[0].equals("red")) { int count = 1; while (count < 64) { String itemName = "minecraft:red_flower"; ItemStack itemstack = new ItemStack(getItemByText(sender, "minecraft:red_flower")); player.inventory.addItemStackToInventory(itemstack); count++; } }else if(args[0].equals("blue")) { int count = 0; while (count < 12) { String itemName = "minecraft:lapis_ore"; ItemStack itemstack = new ItemStack(getItemByText(sender, "minecraft:lapis_ore")); player.inventory.addItemStackToInventory(itemstack); count++; } } } } }
  2. I need some help from people more experienced with forge. Is there a way for me to add blocks that are in the size 32X32. I know how to code animated textures, but is it the same for 32X32 animated textures? I have a third question: Can i make my blocks use the connected textures option in Optifine without having to write the whole "connected textures code" myself? I apologize if this thread does not follow all rules, i have read through em´ all twice today but i could have missed something. Thanks in advance./Me

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.