Everything posted by Anon10W1z
-
[SOLVED] How are vanilla stack sizes drawn on ItemStacks?
I want to draw the potion amplifier of the current potion effect similar to how vanilla Minecraft does for ItemStacks in your inventory. Currently I am using a fixed x and y offset of 12. Is this the right way to do it? if (potionEffect.getAmplifier() > 0) gui.drawString(minecraft.fontRendererObj, Integer.toString(potionEffect.getAmplifier() + 1), xPos + 12, yPos + 12, 0xFFFFFF);
-
[SOLVED]Cannot take changed anvil output from AnvilUpdateEvent
@SubscribeEvent public void onAnvilUpdate(AnvilUpdateEvent event) { if (event.right.getItem() == Items.written_book) { NBTTagCompound bookTagCompound = event.right.getTagCompound(); NBTTagList pagesList = bookTagCompound.getTagList("pages",; ItemStack output = event.left.copy(); NBTTagCompound outputTagCompound = new NBTTagCompound(); NBTTagList loreList = new NBTTagList(); for (int i = 0; i < pagesList.tagCount(); ++i) { String[] pageSplit = pagesList.getStringTagAt(i).substring(1, pagesList.getStringTagAt(i).length() - 1).replace("\\n", "\n").split("\n"); for (String line : pageSplit) loreList.appendTag(new NBTTagString(line)); } outputTagCompound.setTag("Lore", loreList); output.setTagInfo("display", outputTagCompound); if (!event.name.trim().isEmpty()) output.setStackDisplayName(event.name); event.output = output; } } I am using the above code to allow application of written books as lore on items. It works perfectly except for one thing: The result can't be taken out of its slot. Shift clicking and regular left-clicking do not do anything, in fact. Is this a bug or am I doing something wrong? The reason I am replacing the literal "\n" with the actual linefeed "\n" is that it shows as the literal in the lore. Then I have to split the linefeed "\n" because it renders as an LF icon rather than an actual new line. Solved by setting event.cost.
-
How to increase speed of living entity by exact %?
Thanks for all your help.
-
How to increase speed of living entity by exact %?
So when creating my modifier I pass the value 2 for operation? Just making sure I'm on the same page as you. AttributeModifier speedModifier = new AttributeModifier(nimbleUUID, "Nimble", (float) enchantmentLevel * 0.20000000298023224, 2); speedAttribute.applyModifier(speedModifier);
-
How to increase speed of living entity by exact %?
Thanks, the value of potion.moveSpeed is what I am looking for, right?
-
How to increase speed of living entity by exact %?
I am currently using an attribute modifier to increase the speed of an entity. Is the amount I give the attribute modifier a multiplier or an addend?
-
[1.8] all items and blocks rendering as missing model texture.
Do not actually name the folder with dots. Name it with slashes.
-
[1.7.10] Item cooldowns?
NBT and google.
-
[1.8] ArrowCollideWithBlockEvent?
On WorldTickEvent get the list of all arrows in the world. For each arrow, create a new NBT tag compound, call the arrow's write entity to NBT method, then check if the byte tag inGround in your NBT compound equals 1. If it is, do whatever you want. Warning: your code will run always when the arrow is in the ground.
-
[1.8 SOLVED]Creating a Custom Throwable Entity, Texture Not Showing
Register the entity and the entity's renderer (EntityRegistry, RenderingRegistry)
-
[1.7.10] Are there simple, well written, open source mods I can learn from?
Check out my mod on Github. https://github.com/Anon10W1z/CraftPlusPlus
-
My mod wont let me load up mc in development and also it wont let me see..
There is no way you are older than 10.
-
[1.8] Custom text file IO best practices ?
Why do you need a 3D array? The right format would probably be minecraft/yourmod/filename.txt
-
Very strange bug with specific item
Okay then, but is that even relevant to my bug?
-
Very strange bug with specific item
Calling openGui on a EntityPlayerMP doesn't do anything so it doesn't matter.
-
[1.8] Custom Recipe Issue
This is wrong. map.put("Hello", 1); map.put("Goodbye", 1); Works perfectly fine. map.get("Hello"); //1 map.get("Goodbye"); //2 However he doesn't know how to use the syntax properly.
-
Very strange bug with specific item
It probably has nothing to do with it, but here: package io.github.anon10w1z.craftPP.items; import io.github.anon10w1z.craftPP.main.CraftPlusPlus; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; /** * A portable crafting pad that allows you to craft items on the go */ public class ItemCraftingPad extends Item { public ItemCraftingPad() { super(); this.setUnlocalizedName("craftingPad"); this.setCreativeTab(CreativeTabs.tabInventory); } @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { if (player.inventory.hasItem(CppItems.recipe_book) || player.capabilities.isCreativeMode) player.openGui(CraftPlusPlus.instance, 0, world, 0, 0, 0); return itemstack; } }
-
Very strange bug with specific item
Once I wanted to get rid of my own item, so I put it in on the delete item button. But the item didn't delete, rather, it stuck to the button. See the illustration below. Deleting the world and recreating it didn't help. Restarting Minecraft didn't help. Even removing and re-adding the item to the game didn't work. Why did this happen? FYI, my item opens a GUI on right click. My mod maintains 100% server compatibility.
-
Help with hashMaps
You can create your own class that wraps around BlockPos. Override the equals and hashCode methods to return the proper values when the x, y, and z are the same.
-
[1.7.10] [Solved] Make gradle portable?
Look at how my code is set up on my Github repository. If you have all of those folders and files, excluding the readme, license, and version check json, you are good to go.
-
Level-up, mana bar and magics
Why are you modding 1.6.4...seriously 1.8 Forge came out eons ago.
-
[SOLVED] How to use Byte Buddy with obfuscation?
I already had that covered, but thanks for the advice anyways.
-
[1.7.10] [Solved] Make gradle portable?
You have to regenerate the IntelliJ project if you move your project elsewhere. It's not that big of a deal, just set it up again and paste in your existing code.
-
[SOLVED] InvocationTargetException for coremod
It's not that much, plus there isn't any alternative, as far as I know.
-
[1.7] Reading names from file
Create a map yourself. Map entity names to their classes, for example zombie_pig -> EntityPigZombie.class. Then parse the string, lookup the entity name in the map, and voila!
IPS spam blocked by CleanTalk.