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.

loawkise

Members
  • Joined

  • Last visited

Everything posted by loawkise

  1. Ahhh, so I should be using this, right? modelA.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_); With all these parameters...
  2. Oh, but then how can I swap between the models?
  3. I was wondering what the best method for changing an entity's model from one to another is, as the only method I can think of is making a massive model file, then hiding the bits I don't want to see.
  4. That doesn't seem to work...
  5. I am going to use the KeyBinding approach as first suggested as it means the button can be changed in the controls menu. But I don't know how to check whether a certain GUI is open and how to open another one inside my KeyHandler class. I haven't really used events that much.
  6. Ahhh, I thought keyPressed didn't exist and I saw keyTyped but wasn't sure it was the same. Thanks.
  7. Which class do you mean by GuiScreen, the actual GUI class I am guessing and I can't find the keyPressed method.
  8. Okay it isn't anything to with that I have just messed something up
  9. I got that working. It just prints a message to the console. But I can't open my GUI anymore like I could before...
  10. I have 2 different GUIs that I want to be able to swap between when the player presses a key inside either of the GUIs. Does anyone know how to do this?
  11. Worked I believe, thank you.
  12. Ahh okay, I am doing so now.
  13. Container Class: public class ContainerCustom extends Container { protected IInventory i; private int playerInventoryX = 70; private int playerInventoryY = 8; public ContainerCustom(InventoryPlayer inventoryPlayer, IInventory c) { i = c; { addSlotToContainer(new SlotCustom(c, 0, 144, -55)); } bindPlayerInventory(inventoryPlayer); } public boolean canInteractWith(EntityPlayer player) { return i.isUseableByPlayer(player); } protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, playerInventoryX + j * 18, playerInventoryY + i * 18)); } } for (int i = 0; i < 9; i++) { addSlotToContainer(new Slot(inventoryPlayer, i, playerInventoryX + i * 18, playerInventoryY + 54 + 4)); } } @Override public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { return null; } @Override public void onContainerClosed(EntityPlayer par1EntityPlayer) { super.onContainerClosed(par1EntityPlayer); this.i.closeInventory(); } } Slot Class: public class SlotCustom extends Slot { public SlotCustom(IInventory inventory, int par2, int par3, int par4) { super(inventory, par2, par3, par4); } @Override public boolean isItemValid(ItemStack itemstack) { return itemstack.getItem() == Items.arrow; } @Override public int getSlotStackLimit() { return 1; } }
  14. I have made a custom GUI and custom slot, but when I try to click on an item that is inside my custom slot it just falls to the ground instead of following my mouse round like in an inventory. Also it only seems to do it at a certain place. In some places nearer the edge of the screen it will just pop out like before but nearer the center it acts normally.
  15. In the attackEntityAsMob() method, if it returns true does that mean it will attack that target or it will deal damage to the set target?
  16. Well I tried using this in the attackEntityAsMob() method but it has no affect: if(par1Entity instanceof EntityPlayer) { return false; }
  17. The problem is that I have just got 3 target tasks that will make i attack whatever attacks it, its owner or whatever the owner attacks. I want it to be so that if the entity is a player don't try to attack. That is all the AI I have: this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, false)); this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 6.0F, 3.0F)); this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(6, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(2, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(3, new EntityAIOwnerHurtTarget(this));
  18. I want my custom entity to never even try to attack the player, if you know what I mean.
  19. Is there a way to prevent the mob attacking players in the first place because I don't really want them to?
  20. It didn't have any effect... I am not sure what is causing it.
  21. My custom tamed entity will attempt to attack a player but it will deal 0 damage. Why does this happen?
  22. Thanks, I believe I am all set now Can't thank you enough.
  23. Thanks for explaining it and showing me what to do. It makes a lot more sense now. Once last thing though, I want to check the item in a current slot so how would I go about that?
  24. Here it is, I am using the one you gave me and I ma trying to adapt it.
  25. I am just starting to learn how to make GUIs and I have recently made one that has a 2x3 inventory at the top and a 2x1 inventory at the bottom, like the normal inventory just 2 wide. When I put anything in the top left slot it also appears in the bottom left slot and I don't understand why.

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.