Jump to content

Recommended Posts

Posted

 Hey guys, I now have plans for my new armor, yet I don't know how to add potion effects from it.  onItemRightClick() is this the method should I override? also, I am scared because what if I added potion effects from it then I set the time for like 1 minutes, then after that the effects would wear off, the player would need to reequip the armor to have that effects again yet it's annoying.

Posted
5 hours ago, Matryoshika said:

Subscribe to the PlayerTick event, and check if the player has the armour equipped. If so, give the player a potion effect for 1-2 ticks (higher for nightvision/nausea (effect flickers as it ends) etc)

how do I make it for unlimited time.

Posted (edited)

You cannot.
You can either:

  1. apply the potion with 1~2 seconds left, and re-apply it every tick or
  2. apply the potion with Integer#MAX_VALUE as time, but this means that you have to also check if the player ISN'T wearing your armour. This can also lead to false positives in which the player gets the effect from another source, but you might remove it still, because the player doesn't have your armour...

You can add a method in your ClientProxy, supplying the PotionEffect that (will be/has been) added to the player, and in said method call PotionEffect::setPotionDurationMax(true). This only affects the timer cosmetically, making whatever time is left look like **:**.

 

Edited by Matryoshika

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Posted
Just now, Matryoshika said:

You cannot.
You can either:

  1. apply the potion with 1~2 seconds left, and re-apply it every tick or
  2. apply the potion with Integer#MAX_VALUE as time, but this means that you have to also check if the player ISN'T wearing your armour. This can also lead to false positives in which the player gets the effect from another source, but you might remove it still, because the player doesn't have your armour...

You can add a method in your ClientProxy, supplying the PotionEffect that (will be/has been) added to the player, and in said method call PotionEffect::setPotionDurationMax(true). This only affects the timer cosmetically, making whatever time is left look like **:**.

 

Thanks, other question, how do I make it like RESITANCE II or ABSORPTION III

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Which mod was this? What are all the mods that were in use? It will help if enough information to replicate the problem is available.
    • I have been attempting to create a supplementary resource pack with Patchouli in order to add back the guidebook for Better End but unfortunately in every prototype I have made pack.mcmeta and my resource pack are not recognized. I have tested both zipped and unzipped and either way curseforge does not recognize my resource pack as existing. For testing I stripped my pack down to just the pack.mcmeta file and two empty folders labelled data and assets and I know the data folder is not the problem as firstly my first attempts just had an assets folder following Patchouli instructions and data came later in my flailing attempts to make anything in my pack work. The mcmeta file is not recognized whether or not I use this:  { "pack": { "pack_format": 15, "description": "A replacement for the BetterEnd Guide Book." } "language": { "en_US": { "name": "English", "region": "United States" } } } ,or this:  { "pack": { "pack_format": 15, "description": "A replacement for the BetterEnd Guide Book." } } I have made sure to only use lowercase and the pack folder is named better-end-guide. Is this some magic nonsense from me doing this manually instead of using an IDE or similar tool? Could it be because my files are by default in UTF-8 even though ANSI gives the same results? Is there a specific community secret tool I am supposed to use for zipping or specific settings? I am pulling my hair in distress. Unfortunately as there are no errors involved I lack logs to offer, if that disqualifies this thread please do not be harsh and instead if you can then please direct me to a forum with different rules and sufficiently respectful but knowledgeable as to be of assistance. Most of my experience with the programming community has been poor and so naturally I find myself wary.
    • I never picked up a tier 0 dragon skull to my knowledge. One of my other skulls must have bugged out and randomly became one. I was confused on what the heck it was and tried placing it, now the game will only crash because it can't render in whatever the heck the tier 0 skull is. This is on a server and it crashes anyone within render distance.
    • After setting up forge, making sure my drivers are updated, and downloading the create mod i tried to run forge and it said it crashed while trying to render the overlay, i heard about deleting a file called forge-client.toml, but when i looked at the config files(and all the files on my computer) it was nowhere to be found. https://pastebin.com/raw/TTyWWyeS
    • Post logs as described in the FAQ, there might be a clue in there what is going on.
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.