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

Atila1091

Forge Modder
  • Content Count

    29
  • Joined

  • Last visited

Everything posted by Atila1091

  1. I created an attribute to set the digging speed in the BreakSpeed event. My question is if the event is called on the client side? Because if it is, I have to call the setShouldWatch(true); method.
  2. It was not a good idea to use this internal method. Looks like I'll have to use reflection.
  3. I already know what causes the problem: When the player dies the capability is marked invalid and returns: LazyOptional.empty () ;. I am currently using a static internal method: ForgeEventFactory.gatherCapabilities. public static IExample getCapability(Entity entityIn) { return ForgeEventFactory.gatherCapabilities(Entity.class, entityIn, null).getCapability(CAPABILITY).orElseThrow(NullPointerException::new); } See the CapabilityProvider class to understand the problem.
  4. Steps: 1- Have a capability. 2 - Get the capability. Example: public static IExample getCapability(Entity entityIn) { return entityIn.getCapability(CAPABILITY).orElseThrow(NullPointerException::new); } 3 - Use an event. Example: PlayerTickEvent. 4 - Kill the player. (/ kill) 5 - The game throws NullPointerException.
  5. I'm creating a block based on the minecraft chorus plant block. To maintain compatibility I'm using the json forge. The question is if I wrote json correctly, although it is working as expected. Forge json: { "forge_marker": 1, "variants": { "north": { "true": { "submodel": "examplemod:chorus_plant_side" }, "false": { "submodel": { "noside": [ { "model": "examplemod:chorus_plant_noside", "weight": 2 }, { "model": "examplemod:chorus_pla
  6. Solved: public class mcreator_tickHandler { @SubscribeEvent public void tick(PlayerTickEvent event) { double posX = event.player.posX; double posZ = event.player.posZ; if (event.player.dimension == mcreator_aether.DIMID && event.player.posY < -2.0D && event.player.ridingEntity == null && event.player.riddenByEntity == null && !event.player.worldObj.isRemote) { event.player.travelToDimension(0); event.player.setPositionAndUpdate(posX, 256.0D, posZ); } } }
  7. I managed to do my work event. It works with many things, but does not work with teleport. Event: public class mcreator_tickHandler { @SubscribeEvent public void tick(PlayerTickEvent event) { if (event.player.dimension == mcreator_sky.DIMID && event.player.posY < -2.0D) { TestEnvironmentMod.teleportPlayerTosky(event.player, true); } } } Teleport: public static TeleporterDimensionMod skyTeleporter; private static void transferPlayer(EntityPlayer player, int dimID, TeleporterDimensionMod tele, boolean aboveWorld) {
  8. My code does not work when I set for EntityPlayerMP. There is no teleport to one player. What I missed? import mod.mcreator.mcreator_sky; import mod.mcreator.mcreator_sky.TeleporterDimensionMod; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.relauncher.Side; public class TickInGame { private int tickCounter; @SubscribeE
  9. Continued: http://www.minecraftforge.net/forum/index.php/topic,31550.0.html
  10. I have not found someone to help me really. :'( To solve this topic I decompiled the Aether mod 1.2.5 using the MCP, but only 90% of my poblema was completed. http://www.minecraftforge.net/forum/index.php/topic,31521.0.html The public void usePortal(int par1, Teleporter teleporter) it does not exist anymore. I need something to replace it: minecraft.usePortal(((BlockAetherPortal)AetherBlocks.Portal).getDimNumber(minecraft.thePlayer), teleporter); The code adapted to 1.7.10: public class TickHandler { private int tickCounter; @SubscribeEvent public void
  11. How can I make the player teleport to the surface world after falling from a dimension as the Aether mod do? Normal is the player taking damage, which I want to avoid. Please anyone who can help make the class ready, because I never had a lesson of java in life. This is very important for my mod. Translated by google translator.
  12. To remove all edit base class of my mod following the advice of diesieben07 I do resouvir the bucket with water or lava enable my two portals to the sky and hell hard, but new problems appeared: To achieve my objective I recreated the bucket of minecraft and removed the original recipe. The new Class: But the bucket of milk depends on the cow: /** * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. */ public boolean interact(EntityPlayer p_70085_1_) { ItemStack itemstack = p_70085_1
  13. The solution was to increase if (rand.nextInt (% value%) == 0) example: 1- (rand.nextInt (20) == 0) Original, 2- (rand.nextInt (2000) == 0) modified. Thanks for everything.
  14. The spawn code is right, what is wrong is that the code that spawns divides into two parts is not working, spawns the loop does not stop, and the timer does not function. Even when we decrease the number of mobs becomes large again after some time. . The codes are divided into two class in a single java file. it is important read the two class to understand what I tried to do. -mcreator_EntityBossStatus. -mcreator_Entitynightmare. Is there any method to control the spawns number. Phase 1: 3 assassin 3 reaper Phase 2: 4 or 5 assassin 4 reaper.
  15. I need something to control the number of spawn, the mobs number and the time that the mobs are invoked. This was defined in 1.2.5 version only this: private int stopLoop; private int timer; private int spawnNumber; public EntityNightmare (World world) { Super (world); stopLoop = 0; [...] if (attack == 2 && timer == 30 && spawnNumber <= 10) { int i = rand.nextInt (10) - rand.nextInt (10); int j = rand.nextInt (10) - rand.nextInt (10); if (i <= 4 &
  16. I can replace with: Minecraft.getMinecraft().thePlayer;
  17. You helped me a lot. But still the errors in my class. I have a doubt and an error yet. 1- "EntityLivingBase" works for mobs. 2 Ticking entity: if (f < 16F && rand.nextInt(20) == 0 && attack != 2 && !minecraft.thePlayer.isPotionActive(Potion.blindness) && !lastStand) [move] Please help me. :( [/move] If you need the source code of the mod just ask. More information: Description: Ticking entity java.lang.NullPointerException: Ticking entity at mod.mcreator.mcreator_nightmare$Entitynightmare.attackEntity(mcreator_ni
  18. There is a very interesting mob that I add to my mod. The source of it is in the version 1.2.5 (Very old). I can resouver all the errors of the eclipse, but I'm poblemas to add on the player PotionEffect. The code that I use is ((EntityLiving)entity).addPotionEffect(new PotionEffect(Potion.blindness.id, 260, 0)); and the error is: net.minecraft.entity.player.EntityPlayerMP can not be cast to net.minecraft.entity.EntityLiving When I remove the Potion Effect my mob does not behave as it should behave. The Code of the mob : public class Entitynightmare extends EntitynetherBoss i
  19. The best solution was to base edit, insert the modified class to jar file:.minecraft\libraries\net\minecraftforge\forge\1.7.10-forgeversion-1.7.10\forge-forgeversion-1.7.10.jar and apply the JVM argument "-Dfml.ignoreInvalidMinecraftCertificates = true -Dfml.ignorePatchDiscrepancies = true" or install LiteLoader to break the protection against non-original files. Thank you for your idea Opssemnik.
  20. I need the nether portal that does not light up with the BlockObsidian. As I'm fleeing from the coremod the best way to recreate the BlockPortal was clearing your registry. This is very important for my mod. Anyone who can help, you could put the code ready. an example: 1- blockRegistry.addObject(90, "portal", (new BlockPortal()).setHardness(-1.0F).setStepSound(soundTypeGlass).setLightLevel(0.75F).setBlockName("portal").setBlockTextureName("portal")); :'( 2- blockRegistry.addObject(90, "portal", (new BlockPortal1()).setHardness(-1.0F).setStepSound(soundTypeGlass).setLightLevel(
  21. This error happened basically once! Log: [21:24:12 ERROR]: java.io.IOException: Stream closed Game Output: ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [21:11:59] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [21:11:59] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTwe
  22. Need a little help.... OreSpawn for 1.7.10 is almost done. Most things appear to work just fine now. Only one little problem left... LAG! Yes, the dreaded LAG problem. It's back with a vengeance this time. Unfortunately, it is again in a portion of the game code that I have no control over, and so I need you all to help get it fixed. I've already done everything I can, unfortunately. And I can say quite clearly and confidently that there is no problem with the OreSpawn chunk generation code. The number of blocks set are minimized. Blocks are not placed outside of chunk bounds.
×
×
  • Create New...

Important Information

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