Jump to content

Potion Effect on Armor with custom enchantment


yanksrock1019

Recommended Posts

I tried this but it didn't work

 

@SubscribeEvent
public void onPlayerTick(PlayerTickEvent event){
	if(event.player.getCurrentArmor(3)!= null){

	ItemStack boots = event.player.getCurrentArmor(3);	

	if(boots.getItem() == Items.diamond_boots){

	int j = EnchantmentHelper.getEnchantmentLevel(MainClass.speedBoost.effectId, boots);
	if(j > 0){
		 event.player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 50, j - 1));

	}
		}
	}
}

Don't tell me to learn the basics of java, I already know.

Link to comment
Share on other sites

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

    • Hello, Im beginning to learn how to mod with forge, I previously was messing around with spigot but wanted to switch from plugins to full fledged modding. I'm trying to make a recipe for turning a block into charcoal   ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.CHARCOAL_BLOCK_ITEM.get()) .pattern("CCC") .pattern("CCC") .pattern("CCC") .define('C', Items.CHARCOAL) .unlockedBy(getHasName(Items.CHARCOAL), has(Items.CHARCOAL)) .save(pRecipeOutput); This is under an Override build Recipes class and registered with data gen However I get this error that I don't understand the reason behind why I'm getting it   This removes the normal recipe of smelting any wood log into charcoal, but my custom recipe is there and works Any help with the proper way of doing this and solving this issue is appreciated ps: Is the only way to make recipes with forge is through Minecraft's datapack system?? Am I to belive that Spigot has a better implementation of custom recipes then Forge, a Mod API??
    • You need to override the burn time of the corresponding BlockItem, like with this code to register a block that can be used as fuel:   private static <T extends Block> RegistryObject<Item> registerFuelBlockItem(String name, RegistryObject<T> block, int burnTime) { return ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties()) { @Override public int getBurnTime(ItemStack itemStack, @Nullable RecipeType<?> recipeType) { return burnTime; } }); }  
    • Can you post your recipe generation class? You might have forgotten to add the advancement trigger, that part is a bit tricky.
    • https://mclo.gs/YHcp6d1 Got rid of a few of the mods that needed that version of gecko lib and now... 
    • It is worthy of the world to hear this testimony. I'm here to spread the word about Captain WebGenesis's wonderful deeds. My name is Martin Luther. I lost USD 232,000.00 in a binary investment trading scam and didn't realize it until a few weeks later. The site and services I utilized appeared authentic, and everything appeared legitimate until I emailed them to request a withdrawal of my weekly gains and they did not reply. I looked online for a specialized expert to help me get my money back. After reading countless testimonials about how Fastfund Recovery has assisted numerous con victims in getting their money back from fraudulent investment firms, I decided to give the expert a trial. I contacted Fastfund Recovery and submitted my case to the expert. He assured me that all my lost money would be retrieved and returned to my wallet address. Fastfund Recovery worked on my case, and to my amazement, my lost funds were returned to my wallet within 72 hours. Contact Fastfund Recovery right away to have your lost money returned to you. Contact Info  Tele gram ; Fastfundsrecovery mail ; { Fastfundrecovery8 (AT) Gmail com }  
  • Topics

×
×
  • Create New...

Important Information

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