Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

f1rSt1kChannel

Members
  • Joined

  • Last visited

Everything posted by f1rSt1kChannel

  1. Thanks. And lowering the height of the eye / camera player?
  2. А я тебе говорил, что хранить переменную надо в NBT
  3. How to change player model and making the size in one block?
  4. Look this tutorial: http://minalien.com/minecraft-forge-feature-spotlight-config-guis/
  5. player.getCommandSenderName();
  6. Look my updater: https://www.dropbox.com/sh/8m0dkk7xrx4e53a/AADw2-H9sDqAp98MX4DMInVWa/java/agravaine/agravainelib/updater
  7. Helped me FakePlayer FakePlayerFactory.getMinecraft ((WorldServer) world) Working version: public static final Method xpPoints = getExperiencePoints(); @EventHandler public void preInit(FMLPreInitializationEvent event){ MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void dropXP(LivingDropsEvent event){ EntityLivingBase entity = event.entityLiving; World world = entity.worldObj; if(entity != null){ EntityLivingBase living = (EntityLivingBase)entity; if(!world.isRemote && !event.recentlyHit){ int xp = 0; try{ xp = (Integer)xpPoints.invoke(living, FakePlayerFactory.getMinecraft((WorldServer)world)); }catch(Exception e){} while(xp > 0){ int cap = EntityXPOrb.getXPSplit(xp); xp -= cap; living.worldObj.spawnEntityInWorld(new EntityXPOrb(living.worldObj, living.posX, living.posY, living.posZ, cap)); } } } } public static Method getExperiencePoints(){ Method method = null; try{ method = EntityLivingBase.class.getDeclaredMethod("getExperiencePoints", EntityPlayer.class); method.setAccessible(true); }catch(Exception e){} return method; } Thank you, guys! =)
  8. In item class: public boolean doesContainerItemLeaveCraftingGrid(ItemStack iStack){ return false; } public boolean hasContainerItem(){ return true; } public ItemStack getContainerItemStack(ItemStack iStack){ iStack.setItemDamage(iStack.getItemDamage() + 1); return iStack; } In Recipe: GameRegistry.addShapelessRecipe(new ItemStack(Your_Item, 1), new Object[] {new ItemStack(Your_Item_To_Damage, 1, OreDictionary.WILDCARD_VALUE)});
  9. Where can I find a player?
  10. Right? public static Method getExperiencePoints(){ Method method = null; try{ method = EntityLivingBase.class.getDeclaredMethod("getExperiencePoints", EntityPlayer.class); }catch(Exception e){} method.setAccessible(true); return method; } public static final Method xpPoints = getExperiencePoints(); xp = (Integer)xpPoints.invoke(living, (Object[])null); ?
  11. Not work... @SubscribeEvent public void dropXP(LivingDropsEvent event){ EntityLivingBase entity = event.entityLiving; if(entity != null){ EntityLivingBase living = (EntityLivingBase)entity; if(!living.worldObj.isRemote && !event.recentlyHit){ Method getExperiencePoints = null; int xp = 0; try{ getExperiencePoints = EntityLivingBase.class.getDeclaredMethod("getExperiencePoints", EntityPlayer.class); getExperiencePoints.setAccessible(true); xp = (Integer)getExperiencePoints.invoke(null, (Object[])null); }catch(Exception e){ logger.error("Error!", e); } System.out.println(xp); while(xp > 0){ int cap = EntityXPOrb.getXPSplit(xp); xp -= cap; living.worldObj.spawnEntityInWorld(new EntityXPOrb(living.worldObj, living.posX, living.posY, living.posZ, cap)); } } } } d) I do not understand what you wrote... :\
  12. My code: @SubscribeEvent public void dropXP(LivingDropsEvent event){ EntityLivingBase entity = event.entityLiving; if(entity != null){ EntityLivingBase living = (EntityLivingBase)entity; int recentlyHit = ObfuscationReflectionHelper.getPrivateValue(EntityLivingBase.class, living, "recentlyHit"); if(!living.worldObj.isRemote && recentlyHit == 0){ Method getExperiencePoints = null; int xp = 0; try{ Class fake = Class.forName("net.minecraft.entity.EntityLivingBase"); getExperiencePoints = fake.getMethod("getExperiencePoints", EntityPlayer.class); xp = (Integer)getExperiencePoints.invoke(null, (Object[])null); }catch(Exception e){ logger.error("Error!", e); } System.out.println(xp); while(xp > 0){ int cap = EntityXPOrb.getXPSplit(xp); xp -= cap; living.worldObj.spawnEntityInWorld(new EntityXPOrb(living.worldObj, living.posX, living.posY, living.posZ, cap)); } } } } Error: java.lang.NoSuchMethodException: net.minecraft.entity.EntityLivingBase.getExperiencePoints(net.minecraft.entity.player.EntityPlayer) at java.lang.Class.getMethod(Unknown Source) ~[?:1.7.0_55] at agravaine.easyxp.EasyXP.dropXP(EasyXP.java:54) [EasyXP.class:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler_7_EasyXP_dropXP_LivingDropsEvent.invoke(.dynamic) [?:?] at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51) [ASMEventHandler.class:?] at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122) [EventBus.class:?] at net.minecraftforge.common.ForgeHooks.onLivingDrops(ForgeHooks.java:297) [ForgeHooks.class:?] at net.minecraft.entity.EntityLivingBase.onDeath(EntityLivingBase.java:1039) [EntityLivingBase.class:?] at net.minecraft.entity.monster.EntityCreeper.onDeath(EntityCreeper.java:200) [EntityCreeper.class:?] at net.minecraft.entity.EntityLivingBase.attackEntityFrom(EntityLivingBase.java:950) [EntityLivingBase.class:?] at net.minecraft.entity.monster.EntityMob.attackEntityFrom(EntityMob.java:84) [EntityMob.class:?] at net.minecraft.entity.EntityLivingBase.fall(EntityLivingBase.java:1139) [EntityLivingBase.class:?] at net.minecraft.entity.monster.EntityCreeper.fall(EntityCreeper.java:83) [EntityCreeper.class:?] at net.minecraft.entity.Entity.updateFallState(Entity.java:1042) [Entity.class:?] at net.minecraft.entity.EntityLivingBase.updateFallState(EntityLivingBase.java:234) [EntityLivingBase.class:?] at net.minecraft.entity.Entity.moveEntity(Entity.java:856) [Entity.class:?] at net.minecraft.entity.EntityLivingBase.moveEntityWithHeading(EntityLivingBase.java:1689) [EntityLivingBase.class:?] at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2027) [EntityLivingBase.class:?] at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:431) [EntityLiving.class:?] at net.minecraft.entity.monster.EntityMob.onLivingUpdate(EntityMob.java:39) [EntityMob.class:?] at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1820) [EntityLivingBase.class:?] at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:250) [EntityLiving.class:?] at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:47) [EntityMob.class:?] at net.minecraft.entity.monster.EntityCreeper.onUpdate(EntityCreeper.java:176) [EntityCreeper.class:?] at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2254) [World.class:?] at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:697) [WorldServer.class:?] at net.minecraft.world.World.updateEntity(World.java:2214) [World.class:?] at net.minecraft.world.World.updateEntities(World.java:2064) [World.class:?] at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:528) [WorldServer.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:697) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:608) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:746) [MinecraftServer$2.class:?] 0 This method is exists! Line 417 protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { return 0; }
  13. I need to make the experience dropped from mobs not matter whether it killed a player or he died himself. How can this be implemented?
  14. Packet code remained unchanged. Register: packetSender.registerMessage(PacketOpenGui.class, PacketOpenGui.class, 0, Side.SERVER); Sending: @SubscribeEvent public void keyEvent(KeyInputEvent event){ if(key.getIsKeyPressed() && FMLClientHandler.instance().getClient().inGameHasFocus){ Esoteric.logger.info("MEOW"); Esoteric.packetSender.sendToServer(new PacketOpenGui(Esoteric.instance, 2)); } } Gui handler: public class EsotericGuiHandler implements IGuiHandler{ public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z){ TileEntity tileEntity = world.getTileEntity(x, y, z); if(id == 0){ return new ContainerRelic(player.inventory, (TileEntityRelic)tileEntity); } if(id == 1){ return new ContainerCampfire(player.inventory, (TileEntityCampfire)tileEntity); } if(id == 2){ return new ContainerPlayerExtended(player.inventory, !world.isRemote, player); } return null; } public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z){ TileEntity tileEntity = world.getTileEntity(x, y, z); if(id == 0){ return new GuiRelic(player.inventory, (TileEntityRelic)tileEntity); } if(id == 1){ return new GuiCampfire(player.inventory, (TileEntityCampfire)tileEntity); } if(id == 2){ return new GuiPlayerExtended(player); } return null; } }
  15. I have all the same. By the way, now the packet is sent without errors, but still GUI will not open ...
  16. I need to open by pressing the GUI, can give a working version? P.S Azanor makes in one class and it all works [https://github.com/Azanor/Baubles/blob/master/src/main/java/baubles/common/network/PacketOpenBaublesInventory.java].
  17. Thanks. Not work... Writes the same thing... My packet: public class PacketOpenGui implements IMessage, IMessageHandler<PacketOpenGui, IMessage>{ Object mod; int id; public PacketOpenGui(){} public PacketOpenGui(Object modGui, int guiId){ mod = modGui; id = guiId; } public void fromBytes(ByteBuf buf){} public void toBytes(ByteBuf buf){} public IMessage onMessage(PacketOpenGui message, MessageContext ctx){ Esoteric.logger.info("DUDE"); EntityPlayerMP player = ctx.getServerHandler().playerEntity; player.openGui(mod, id, player.worldObj, (int)player.posX, (int)player.posY, (int)player.posZ); return null; } }
  18. How to get there player?
  19. Hello I'm trying to send a packet to the server to open a GUI, but the console writes the following: [server thread / ERROR] [FML]: Messages for channel Esoteric for side SERVER were not processed by the embedded channel [agravaine.agravainelib.network.packet.message.PacketOpenGui @ 198c9c7]. They have been dropped. Length: 0 Made from the tutorial http://www.minecraftforge.net/wiki/Netty_Packet_Handling.
  20. Is there something like that?
  21. I understand. I need at least suggestions on how it can be implemented.
  22. How to make something like this? https://www.youtube.com/watch?v=Q_adb2Af1C0 I need to make a block height of two meters and TileEntity and GUI. And that was the stroke and the collision height of two meters . Sorry for my english.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.