fork download
  1. package layer;
  2.  
  3. import net.minecraftforge.common.MinecraftForge;
  4. import net.minecraftforge.event.ForgeSubscribe;
  5. import net.minecraftforge.event.entity.player.PlayerEvent;
  6. import cpw.mods.fml.common.Mod;
  7. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  8.  
  9. @Mod(modid = "layer", name = "Layer", version = "0")
  10. public class Layer {
  11.  
  12. @Mod.EventHandler
  13. public void onPreInit(FMLPreInitializationEvent event)
  14. {
  15. MinecraftForge.EVENT_BUS.register(this);
  16. }
  17.  
  18. @ForgeSubscribe
  19. public void getBreakSpeed(PlayerEvent.BreakSpeed event)
  20. {
  21. double y = event.entity.posY;
  22. if(y < 10)
  23. event.newSpeed /= 20;
  24. else if(y < 20)
  25. event.newSpeed /= 10;
  26. }
  27.  
  28. }
  29.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:10: error: class Layer is public, should be declared in a file named Layer.java
public class Layer {
       ^
Main.java:3: error: package net.minecraftforge.common does not exist
import net.minecraftforge.common.MinecraftForge;
                                ^
Main.java:4: error: package net.minecraftforge.event does not exist
import net.minecraftforge.event.ForgeSubscribe;
                               ^
Main.java:5: error: package net.minecraftforge.event.entity.player does not exist
import net.minecraftforge.event.entity.player.PlayerEvent;
                                             ^
Main.java:6: error: package cpw.mods.fml.common does not exist
import cpw.mods.fml.common.Mod;
                          ^
Main.java:7: error: package cpw.mods.fml.common.event does not exist
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
                                ^
Main.java:9: error: cannot find symbol
@Mod(modid = "layer", name = "Layer", version = "0")
 ^
  symbol: class Mod
Main.java:13: error: cannot find symbol
	public void onPreInit(FMLPreInitializationEvent event)
	                      ^
  symbol:   class FMLPreInitializationEvent
  location: class Layer
Main.java:19: error: package PlayerEvent does not exist
	public void getBreakSpeed(PlayerEvent.BreakSpeed event)
	                                     ^
Main.java:12: error: package Mod does not exist
	@Mod.EventHandler
	    ^
Main.java:18: error: cannot find symbol
	@ForgeSubscribe
	 ^
  symbol:   class ForgeSubscribe
  location: class Layer
Main.java:15: error: package MinecraftForge does not exist
		MinecraftForge.EVENT_BUS.register(this);
		              ^
12 errors
stdout
Standard output is empty