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.

Anon10W1z

Forge Modder
  • Joined

  • Last visited

Everything posted by Anon10W1z

  1. 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);
  2. @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.
  3. 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);
  4. Thanks, the value of potion.moveSpeed is what I am looking for, right?
  5. 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?
  6. Do not actually name the folder with dots. Name it with slashes.
  7. 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.
  8. Register the entity and the entity's renderer (EntityRegistry, RenderingRegistry)
  9. Check out my mod on Github. https://github.com/Anon10W1z/CraftPlusPlus
  10. Why do you need a 3D array? The right format would probably be minecraft/yourmod/filename.txt
  11. Okay then, but is that even relevant to my bug?
  12. Calling openGui on a EntityPlayerMP doesn't do anything so it doesn't matter.
  13. 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.
  14. 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; } }
  15. 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.
  16. 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.
  17. 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.
  18. Why are you modding 1.6.4...seriously 1.8 Forge came out eons ago.
  19. I already had that covered, but thanks for the advice anyways.
  20. 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.
  21. It's not that much, plus there isn't any alternative, as far as I know.
  22. 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!

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.