i wanted to create drunk effect as the food item is a beer. I am trying to create a stagger like effect where the player would randomly move. I ended up coding the effect into the onItemUseFinish. But I'm unsure how to keep its effect working for an extended period of time. Using a loop gives me: The client has sent too many requests within a certain amount of time
Well, I'm taking a look at the chorus fruit's code from vanilla, seems decently similar to what you're wanting to do, just add the movement as a method, and remove the random teleport and you should be decently golden. Here is the code for the random tp from chorus fruit.
Does pretty much what you did, I can't help with specifics, sorry. I'm not that advanced yet.
Hey thanks Maxride that code does work but the movement will only occur once after the item has been eaten. Even if I loop the call to the movement method it will only occur once.
just use a while loop inside the method that checks if the player has the potion effect, then execute random movement patterns. Don't be afraid to shake the camera a bit either, that'd be cool! Please either post here or dm a github link or a place I can keep up to date with minor changes. I'd love to keep up with your progress. Perhaps we can learn from each other, since (pretty sure you're also new to modding) we're both noobs
Hi I am having trouble with figuring out how to create my own PotionEffect that I would like to add to food Items
I currently have made this as a test:
this.setPotionEffect(new PotionEffect(MobEffects.NAUSEA, 200), 0.7F);
This code works fine but I would like to create my own effect.
Thanks
What exactly are you looking to do with the potion effect?
Thanks
MaxTheMooshroom~
i wanted to create drunk effect as the food item is a beer. I am trying to create a stagger like effect where the player would randomly move. I ended up coding the effect into the onItemUseFinish. But I'm unsure how to keep its effect working for an extended period of time. Using a loop gives me: The client has sent too many requests within a certain amount of time
Well, I'm taking a look at the chorus fruit's code from vanilla, seems decently similar to what you're wanting to do, just add the movement as a method, and remove the random teleport and you should be decently golden. Here is the code for the random tp from chorus fruit.
Does pretty much what you did, I can't help with specifics, sorry. I'm not that advanced yet.
Thanks
MaxTheMooshroom~
Hey thanks Maxride that code does work but the movement will only occur once after the item has been eaten. Even if I loop the call to the movement method it will only occur once.
just use a while loop inside the method that checks if the player has the potion effect, then execute random movement patterns. Don't be afraid to shake the camera a bit either, that'd be cool! Please either post here or dm a github link or a place I can keep up to date with minor changes. I'd love to keep up with your progress. Perhaps we can learn from each other, since (pretty sure you're also new to modding) we're both noobs
Thanks
MaxTheMooshroom~