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

How to make a effect happen every second


Recommended Posts

14 minutes ago, diesieben07 said:

Learn basic Java if you do not know how to implement an interface.

Now i get 
 

[16:35:48] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception
net.minecraft.crash.ReportedException: Ticking player
	at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:137) ~[forge:?] {re:classloading}
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:865) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:787) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.integrated.IntegratedServer.tickServer(IntegratedServer.java:78) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:642) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:232) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:832) [?:?] {}
Caused by: java.lang.NullPointerException: Registry Object not present: mcore:freeze
	at java.util.Objects.requireNonNull(Objects.java:348) ~[?:?] {}
	at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:120) ~[forge:?] {re:classloading}
	at mod.trianglesinpoo.mcores.CRYOCOCKTAIL.finishUsingItem(CRYOCOCKTAIL.java:33) ~[?:?] {re:classloading}
	at net.minecraft.item.ItemStack.finishUsingItem(ItemStack.java:221) ~[forge:?] {re:classloading,xf:fml:forge:filled_map.4,xf:fml:forge:itemstack}
	at net.minecraft.entity.LivingEntity.completeUsingItem(LivingEntity.java:2843) ~[forge:?] {re:classloading}
	at net.minecraft.entity.player.ServerPlayerEntity.completeUsingItem(ServerPlayerEntity.java:1057) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.entity.LivingEntity.updatingUsingItem(LivingEntity.java:2723) ~[forge:?] {re:classloading}
	at net.minecraft.entity.LivingEntity.tick(LivingEntity.java:2114) ~[forge:?] {re:classloading}
	at net.minecraft.entity.player.PlayerEntity.tick(PlayerEntity.java:223) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.entity.player.ServerPlayerEntity.doTick(ServerPlayerEntity.java:404) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.network.play.ServerPlayNetHandler.tick(ServerPlayNetHandler.java:207) ~[forge:?] {re:classloading}
	at net.minecraft.network.NetworkManager.tick(NetworkManager.java:226) ~[forge:?] {re:classloading}
	at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:134) ~[forge:?] {re:classloading}
	... 6 more
[16:35:48] [Render thread/FATAL] [minecraft/ThreadTaskExecutor]: Error executing task on Client
java.lang.NullPointerException: Registry Object not present: mcore:freeze
	at java.util.Objects.requireNonNull(Objects.java:348) ~[?:?] {}
	at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:120) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
	at mod.trianglesinpoo.mcores.CRYOCOCKTAIL.finishUsingItem(CRYOCOCKTAIL.java:33) ~[main/:?] {re:classloading}
	at net.minecraft.item.ItemStack.finishUsingItem(ItemStack.java:221) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,xf:fml:forge:filled_map.4,xf:fml:forge:itemstack}
	at net.minecraft.entity.LivingEntity.completeUsingItem(LivingEntity.java:2843) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
	at net.minecraft.entity.player.PlayerEntity.handleEntityEvent(PlayerEntity.java:415) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.entity.player.ClientPlayerEntity.handleEntityEvent(ClientPlayerEntity.java:447) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.network.play.ClientPlayNetHandler.handleEntityEvent(ClientPlayNetHandler.java:958) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.network.play.server.SEntityStatusPacket.handle(SEntityStatusPacket.java:35) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
	at net.minecraft.network.play.server.SEntityStatusPacket.handle(SEntityStatusPacket.java:12) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
	at net.minecraft.network.PacketThreadUtil.lambda$ensureRunningOnSameThread$0(PacketThreadUtil.java:19) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.doRunTask(ThreadTaskExecutor.java:136) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.RecursiveEventLoop.doRunTask(RecursiveEventLoop.java:22) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.pollTask(ThreadTaskExecutor.java:109) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.runAllTasks(ThreadTaskExecutor.java:97) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:947) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.run(Minecraft.java:607) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?] {}
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {}
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {}
AL lib: (EE) alc_cleanup: 1 device not closed

What did i do wrong?

Link to post
Share on other sites
2 minutes ago, diesieben07 said:

CRYOCOCKTAIL - show this class.

import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Food;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.MilkBucketItem;
import net.minecraft.item.UseAction;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Effects;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.World;

public class CRYOCOCKTAIL extends Item{

	public CRYOCOCKTAIL() {
		
			super(new Item.Properties().stacksTo(1).tab(ItemGroup.TAB_MISC).food(new Food.Builder().nutrition(8).effect(new EffectInstance(Effects.SLOW_FALLING,1000,2),1).saturationMod(1.2f).alwaysEat().build()));
		
		
	}
	@Override
	public UseAction getUseAnimation(ItemStack stack) {
		return UseAction.DRINK;
		
	}
	ModEffects e = new ModEffects();
	@Override
	public ItemStack finishUsingItem(ItemStack stack, World worldIn, LivingEntity entityLiving) {
		entityLiving.addEffect(new EffectInstance(e.FREEZE.get()));
		ItemStack itemstack = super.finishUsingItem(stack, worldIn, entityLiving);
		return entityLiving instanceof PlayerEntity && ((PlayerEntity)entityLiving).abilities.mayfly ? itemstack : new ItemStack(Items.GLASS_BOTTLE);

	}
	public void doSlideEffect(LivingEntity entityLiving) {
		
	}


}

 

Link to post
Share on other sites
1 minute ago, eggpasta said:

ModEffects e = new ModEffects();

Why?

 

Why is ModEffects.FREEZE not a static field? Please follow the instructions in the linked documentation.

Link to post
Share on other sites
2 minutes ago, diesieben07 said:

Why?

 

Why is ModEffects.FREEZE not a static field? Please follow the instructions in the linked documentation.

Ok i changed that but the same error occurs

Link to post
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.

Guest
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.



×
×
  • Create New...

Important Information

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