Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

LK1905

Members
  • Content Count

    42
  • Joined

  • Last visited

Community Reputation

0 Neutral

About LK1905

  • Rank
    Tree Puncher

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Is there any particular reason why LivingEquipmentChangeEvent is non-cancelable? Like, is it a decision by the Forge devs to make it non-cancelable, or is it to do with how Forge interacts with Minecraft, where some things just can't be cancelled?
  2. I tried that, it made no difference regardless of which line came first.
  3. How do I drop the item without cloning it? I've used Player#dropItem (both methods), and it keeps the original in the offhand slot and drops a copy. I tried using ItemStack#Shrink at the same time, hoping that would destroy the original while still dropping the copy, but that just destroys the original before the copy can be made.
  4. Hi, there are 2 things I want to do: 1. Prevent tiered items from being placed in the offhand slot 2. Prevent armour from being placed in the hotbar How would I go about doing these things?
  5. What exactly do I put in the Button.ITooltip parameter? How do I "give it an Implementation"? I can't find any examples of it actually being used, neither in Vanilla or in other mods.
  6. If I don't have that there, the buttons don't update. Besides, thats not the issue I was asking, the issue is that only the last button hovered over does whats in that statement.
  7. Sorry for the late response, but I found how to make the buttons update. All I had to do was to clear existing buttons and re-run the init, whenever the buttons are hovered over, like this: if(styleButton[i].isHovered()) { this.renderTooltip(stack, new StringTextComponent(styleCap.getStyleDescription(i)), mouseX, mouseY); buttons.clear(); this.init(); } However I still have a problem with that statement, in that it still only works on the last non-null button, and not on any of the previous buttons. Anyone know why the statement would do so? Full class here.
  8. For the "listen to the change" part, there's a mouseClicked method in the Widget class (which the Button class extends from) that I think would do the job, but I'm not sure what the int button parameter does, do you know?
  9. I ended up finding a solution elsewhere for my buttons to display the updated texture on the correct button: package lk1905.gielinorcraft.client.gui.widget; import lk1905.gielinorcraft.Gielinorcraft; import lk1905.gielinorcraft.capability.attackstyle.AttackStyleCapability; import lk1905.gielinorcraft.capability.attackstyle.IAttackStyle; import lk1905.gielinorcraft.network.PacketHandler; import lk1905.gielinorcraft.network.attackstyle.AttackStyleClientPacket; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.widget.button.ImageButton; import net.minecraft.entity.player
  10. Okay, I removed the static from the player and styleCap variables, are you able to help me with the other problems I mentioned?
  11. The screen has 3 buttons, all with a "style id", which, when pressed, sends a packet to set an "active attack style", which is decided by the style id of the button pressed. The buttons are all grey, except for the button with the active style id, which is supposed to turn red, and also make the previously active button grey. The button colours do update, but only if i close/reopen the screen. I would like it to be able to update the colours while the screen is still open. Screen class package lk1905.gielinorcraft.client.gui.screen; import com.mojang.blaze3d.matrix.MatrixStack;
  12. Hi, I have 2 questions: 1. How do i get a gui screen to update instantly? My screens only update when I open/close them, or change the size of the Minecraft window. My in game gui updates instantly, which is what I want my screens to do aswell. 2. I have buttons on this gui that I want to, when hovered over, to display a string/tooltip. There is an ITooltip parameter in the constructor of the Button class, but I'm not sure what to put in there if I just want to display a string. How would I do that? Thanks.
  13. I solved the problem. The problem as that I didn't have the getMaxHealth() method saved within my serializeNBT() method, so the game still thought the value was zero. Saving that value fixed the problem.
  14. I'm trying to modify an entity's max health based on a stat, but either its not working or my client isn't acknowledging the change. The method for the change. Full class here. @Override public void modifyMaxHealth(LivingEntity entity) { if(entity == null) { return; } entity = getEntity(); final float newAmount = getMaxHealth(); final float oldAmount; final UUID MODIFIER_ID = UUID.fromString("d5d0d878-b3c2-469b-ba89-ac01c0635a9c"); final ModifiableAttributeInstance health = entity.getAttribute(Attributes.MAX_HEALTH); final AttributeModifier mod = new Att
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.