Posted May 26, 201510 yr Hello, im trying to make command which will work in survival mode too command Class package fewmorethings.other.commands;import java.util.Iterator;import java.util.List;import fewmorethings.help.ChatHelper;import net.minecraft.command.CommandBase;import net.minecraft.command.ICommandSender;import net.minecraft.entity.passive.EntityPig;import net.minecraft.entity.player.EntityPlayer;import net.minecraft.init.Blocks;import net.minecraft.init.Items;import net.minecraft.item.Item;import net.minecraft.item.ItemStack;import net.minecraft.item.ItemSword;import net.minecraft.item.crafting.CraftingManager;import net.minecraft.item.crafting.IRecipe;import net.minecraft.potion.Potion;import net.minecraft.potion.PotionEffect;import net.minecraft.stats.AchievementList;import net.minecraft.util.ChatComponentTranslation;public class Achievements extends CommandBase {public String getCommandName() { return "achievements"; } public String getCommandUsage(ICommandSender CommandSender) { return "/achievements"; } public int getRequiredPermissionLevel() { return 0;} public void processCommand(ICommandSender CommandSender, String[] par2ArrayOfStr) { EntityPlayer player = getCommandSenderAsPlayer(CommandSender); player.triggerAchievement(AchievementList.diamonds); } } this isnt working thx for any help I'm beginner in java and in minecraft modding. Please be specific. Any code examples are appreciated. Sorry for my english i'm from Czech republic. Please hit that thank you button if i helped
May 27, 201510 yr Override canUseCommand or something similar. PS: Whether a player can use a command depends on "cheat enabled" not "creative mode". Author of Tao Land Mod. http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img] Also, author of RenderTo ---- I'm not an English native speaker. I just try my best.
May 27, 201510 yr Author ok but how to check if cheat mode is enabled I'm beginner in java and in minecraft modding. Please be specific. Any code examples are appreciated. Sorry for my english i'm from Czech republic. Please hit that thank you button if i helped
May 27, 201510 yr Author thank you very much i did solve it like so : @Override public boolean canCommandSenderUseCommand(ICommandSender sender) { boolean op = MinecraftServer.getServer().getConfigurationManager().func_152596_g(player.getGameProfile()); return !op || op; } I'm beginner in java and in minecraft modding. Please be specific. Any code examples are appreciated. Sorry for my english i'm from Czech republic. Please hit that thank you button if i helped
May 27, 201510 yr Cough. @Override public boolean canCommandSenderUseCommand(ICommandSender sender) { return true; } A || !A will always be true Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 27, 201510 yr Author Ye thats true nad why getRequiredPermissionLevel doesnt work ? I'm beginner in java and in minecraft modding. Please be specific. Any code examples are appreciated. Sorry for my english i'm from Czech republic. Please hit that thank you button if i helped
May 27, 201510 yr Because the code in EntityPlayerMP that checks for commands is broken for anything but vanilla commands. Mojang has done a lot of things to make modder's lives easier, with some benefit to themselves, but from a "just Mojang" perspective the cost:benefit analysis comes out in favor of not-doing them. For instance, removing block IDs and making things referenced by string. A lot of work on their part with a pretty small benefit for their continued development, but which makes leaps and bounds improvements for modders. Then on other things they go "can't reproduce it with just vanilla, not a bug, closed." Say...maps only working in dimension IDs less than 128 (because the dimension ID is an integer, but maps use unsigned shorts!). Actually, it is a bug, you're using an int in one place and a short in the other, that will be a problem eventually and with access to the source code I can prove it. It just doesn't have any visible effect until a mod is introduced. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 27, 201510 yr Author Thank you guys and one more question because i dont want to create another thread for it ... how to check in which dimension is player? I'm beginner in java and in minecraft modding. Please be specific. Any code examples are appreciated. Sorry for my english i'm from Czech republic. Please hit that thank you button if i helped
May 27, 201510 yr Thank you guys and one more question because i dont want to create another thread for it ... how to check in which dimension is player? player.worldObj.provider.dimensionId Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 27, 201510 yr Author and 1 more : vazkii somehow did that when you will right-click empty glass bottle in the end you will get ender air in the bottle ... how to do that ? is here somewhere event for it or something ? i was looking in botania src code for like 2 hours now and cant find it I'm beginner in java and in minecraft modding. Please be specific. Any code examples are appreciated. Sorry for my english i'm from Czech republic. Please hit that thank you button if i helped
May 27, 201510 yr In your item class override onItemRightClick and add the code there to check if the dimension is correct and if so, replace the old item with the new one. Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
May 28, 201510 yr Author do you think vazkii made new water bottle ? and removed the old one ? I'm beginner in java and in minecraft modding. Please be specific. Any code examples are appreciated. Sorry for my english i'm from Czech republic. Please hit that thank you button if i helped
May 28, 201510 yr Author Wow ok thank you thats all i want to know I'm beginner in java and in minecraft modding. Please be specific. Any code examples are appreciated. Sorry for my english i'm from Czech republic. Please hit that thank you button if i helped
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.