Created
February 13, 2018 13:59
-
-
Save Densyakun/bdfdbcbfef91ab7e957533718851639e to your computer and use it in GitHub Desktop.
[ForgeMOD]最強になるMOD?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.densyakun.forge.test; | |
import java.util.List; | |
import cpw.mods.fml.common.FMLCommonHandler; | |
import cpw.mods.fml.common.Mod; | |
import cpw.mods.fml.common.Mod.EventHandler; | |
import cpw.mods.fml.common.event.FMLInitializationEvent; | |
import cpw.mods.fml.common.eventhandler.SubscribeEvent; | |
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; | |
import net.minecraft.client.Minecraft; | |
import net.minecraft.entity.Entity; | |
import net.minecraft.entity.player.EntityPlayer; | |
@Mod(modid="test", version="1.0") | |
public class Main { | |
@EventHandler | |
public void init(FMLInitializationEvent event) { | |
FMLCommonHandler.instance().bus().register(this); | |
} | |
@SubscribeEvent | |
public void onPlayerTick(PlayerTickEvent event) { | |
Minecraft.getMinecraft().thePlayer.setSprinting(true); | |
Minecraft.getMinecraft().thePlayer.setAir(10); | |
Minecraft.getMinecraft().thePlayer.setHealth(20f); | |
Minecraft.getMinecraft().thePlayer.setFire(0); | |
Minecraft.getMinecraft().thePlayer.setScore(10000); | |
List<Entity> list = Minecraft.getMinecraft().theWorld.getLoadedEntityList(); | |
for (int a = 0; a < list.size(); a++) { | |
if ((list.get(a) instanceof EntityPlayer) ? !((EntityPlayer) list.get(a)).getDisplayName().equals(Minecraft.getMinecraft().thePlayer.getDisplayName()) : true) { | |
Minecraft.getMinecraft().thePlayer.attackTargetEntityWithCurrentItem(list.get(a)); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment