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.

Koi

Members
  • Joined

  • Last visited

  1. Hello, fellow modders. I have a mob that spawns custom entities and saves references to those entities so that it can control them. The problem is that the references are not persistent when you leave the world. So when you rejoin the world, the mob can no longer control the entities it spawned. So how can I save persistent references to entities? I have tried so much but nothing seems to work. If you need more details in order to help I'd be happy to share any code.
  2. Hi there! I am making a mob that summons an entity on spawn. I rotate this entity around the mob every tick. To do this, I wrote this function that is called from aiStep(). Entity shield_0; // this is summoned onSpawn private void rotateShields() // this is called every tick from aiStep { rotation_0 = rotate(rotation_0, 5f); rotation_1 = rotation_0 + 90.0f; if (this.shield_0 != null) { double shieldX = this.getX() + Math.cos(Math.toRadians(rotation_0)) * 2; double shieldZ = this.getZ() + Math.sin(Math.toRadians(rotation_0)) * 2; this.shield_0.setPos(shieldX, this.getY() + 2, shieldZ); this.shield_0.setYRot((rotation_0 - 90.0f)); } } private float rotation_0; float rotate(float rot, float timePerLoop) { timePerLoop = 360.0f / (20 * timePerLoop); if (rot < 360) rot += timePerLoop; else { rot = 0; } return rot; } For some reason, the rotation of the entity works just fine while the y-pos of the entity slowly falls down until it hits the ground and jumps back up to where it is supposed to go. I even did a "System.out.println(this.shield_0.getY());" and that prints out the correct y-value at a stable rate while the actual entity position in-game is wonky. This strange behavior is leading me to believe that there is some weird syncing issue, but I have no idea how to solve it or why it's happening.
  3. Hi! im making a mod with a special type of enchantments that you get from something thats not an enchanting table, and I want to give these special enchantments a red glow. Is that possible?
  4. @Siqhter OMG THANK YOU SO MUCH!!!
  5. I am pretty new to modding MC and I have been trying to make a cooldown for my Staff that I have making for a long time and I just cant seem to get it right! This is what my code looks like right now. Thanks a lot if you help and could you tell me if I was close or on the right track? :) public int coolDown = 0; public boolean canUse; @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { ItemStack itemstack = playerIn.getHeldItem(handIn); if(canUse == true) Actions.chatAtPlayer(playerIn, "hi"); if(coolDown <= 0) { coolDown = 100; } if(coolDown > 0) Actions.chatAtPlayer(playerIn, "" + coolDown); return super.onItemRightClick(worldIn, playerIn, handIn); } @Override public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { if(coolDown > 0) coolDown--; canUse = false; if(coolDown == 0) canUse = true; super.onUpdate(stack, worldIn, entityIn, itemSlot, isSelected); }

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.