
squidlex
Members-
Content Count
144 -
Joined
-
Last visited
Community Reputation
4 NeutralAbout squidlex
-
Rank
Creeper Killer
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
How to get the sum of all enchantment levels equipped
squidlex replied to squidlex's topic in Modder Support
hahaha I'm very tired. (and an idiot from the looks of things) -
How to get the sum of all enchantment levels equipped
squidlex replied to squidlex's topic in Modder Support
Thanks Diesieben! I added this to my Utils class. I used this for reference whilst doing it, thanks Tavi! -
squidlex started following How to cancel an event without subscribing to it, How to get the sum of all enchantment levels equipped, Check if player wakes up in the Morning and and 3 others
-
Hi! I'm trying to get the total enchantment level of a specific enchantment equipped when wearing armor. For example, if the player has: Boots with CUSTOM_ENCH V Helmet with CUSTOM_ENCH III I will get the value 5 + 3 = 8. I've figured out how to get the max level, (e.g. the example above would return 5 as it's larger than 3), however I haven't figured out how to get the cumulative value. Thanks for your help!
-
This is perfect, thank you!
-
How to create the regeneration effect on hearts for other HUD elements
squidlex replied to squidlex's topic in Modder Support
Thank you! -
Hi, I'm trying to detect when the player wakes up in the morning. The Player Wakes Up Event is firing whenever I press wake up.. So I'm wondering if there's a workaround to only run my code if the player slept through the night? Checking if the world is daytime isn't working, as the event seems to fire before the time is changed. Thanks for your help!
-
I have a custom HUD above the hunger bar that I want to imitate the 'wave' effect applied on the player's hearts when they have the regeneration effect. I've tried to make sense of the Class for this, however it seems incredibly confusing as the variables are very shortly named. Any help would be greatly appreciated! Of course I'm not asking for someone to do this for me, just if anyone knows any tips or pointers to get me started.
-
How to run code every time a Potion effect is applied
squidlex replied to squidlex's topic in Modder Support
I see, thank you so much for all your help! -
How to run code every time a Potion effect is applied
squidlex replied to squidlex's topic in Modder Support
Thank you! My Potion isn't using Attribute modifiers however, is there a way I can still use this? -
I'm currently using a tick event to check if the Player has the Potion Effect, with a Boolean Capability to only run the code on the first tick of the potion effect being applied. PSEUDOCODE: tickEvent(PlayerTickEvent event) { if(we're on the server){ if(player doesn't have effect capability && player has potion effect) { // Do stuff give player active effect capability; } else if (player has effect capability && player does not have potion effect) { // Do stuff remove player active effect capability } } } The issue here is that if the potion effect is applied again whilst the player has it, the first line of code doesn't run. Is there a workaround to this? Thanks for your help!
-
Hi, I'm wondering if anyone knows the best way to attach a custom attribute to a pre-existing entity. Thanks for your help!
-
I have a custom event with the @Cancelable annotation, that I want to only do something if it isn't canceled. At the moment, I'm doing something like: if (!event.isCanceled()) { //Do Something } Which obviously doesn't work. How would I go about making an event that when fired, only runs code if it isn't cancelled? Thanks for your help!
-
How to cancel an event without subscribing to it
squidlex replied to squidlex's topic in Modder Support
It's my own custom one. That's a shame but thank you for your quick reply! -
In my Mod I need to cancel a client event from the server side, and I haven't figured out a way to achieve this. Right now I'm sending a packet to the Client, but I don't know where to go from there. Any help would be greatly appreciated!