Jump to content

Zerahi

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by Zerahi

  1. Once or twice I have entered my custom dimension and had a few mobs near the portal be invisible but still able to attack. re-connecting fixes this. I had two players on and both couldn't see some mobs, some could see ones others couldn't at the same time. happened with the Void Beast and Shade but they are the only ones you see entering the dimension. Any ideas why this could be happening? Nothing shows up in the logs and they are general world spawns, usually only happens the first time someone enters that dimension in their area when everything is loaded. Mob class/Model class/Render class Render Registry - triggered in client proxy in pre-init Entity Registry - triggered in general registry during pre-init
  2. That would work to write templates you already had loaded but all the read or add function in the manager are private. I created a new template and it was an item variable. I got it stored to a new nbt compound and then looked how the template manager saves nbt files from and nbt and it's just a file stream writer with CompressedStreamTools.writeCompressed(nbt , OutStream). So its working now.
  3. I'm trying to figure out how to use this method but I can't get it to work. It starts writing but the overloads. I can't find any examples of what to put for DataFixer version. Also how to refer to my current template. net.minecraft.world.gen.structure.template.TemplateManager TemplateManager manage = new TemplateManager("/save", new DataFixer(1)); manage.writeTemplate(null, new ResourceLocation("?")); TemplateManger#writeTemplate comment says "writes the template to an external folder" I have the template in nbt right now on and item.
  4. yeah but then like an item frame could be used to get around it too. and i have a charging stand that just right click with no inventory, just takes it from you hand and copy it, the upkeep tick also charges the item so its not like its not running anyway just seeing if their was a better way
  5. I have an activated item that gives a buff, i got it to take the buff off if it leaves your action bar, and if you drop it. My only problem is it a player puts it in an inventory like a chest nothing gets called that i can see, any method for that i'm missing? Or should i just stick to short duration buffs so they fall off it its not maintained. onUpdate stops calling on leave but that also means i cant turn it off with that and onDroppedByPlayer doesn't call unless its spawns in world
  6. no the mod packs pick a version with a lot of mods and set it all up nice then wait for enough mods for a new pack, so make mods for current and be in the new packs =P
  7. i went right to 1.10.2 from 1.7.10 most of the 1.8 -1.9 code applies so you can look at tutorials for them to get close, anything after 1.7.10 is a bit hard to find examples for but not impossible (github has a few) i'm fairly far into my complex mod i started a week ago
  8. i didn't find that out in examples i just assumed it since you spawn items in with the mod id and that how its refereed to in game on items
  9. it works perfectly with my mod id have 2 mobs spawnable, with forge your mod id is the reference to your instance
  10. ref.modid is linked to my mod id @Mod(modid = Ref.MODID, public static final String MODID = "rv"; so i could replace that ref.modid with just rv and it would work, but i just like refering so i remember where its from
  11. its to my ref class that stores things its just the mod id modid = Ref.MODID
  12. happened to me once when i messed up my register i dont know exactly what fixed it but here is my working entity register (had something to do with the registry id being registered with the mc not the mod id) public class VoidEntities { public static void registerEntities() { registerEntity(EntityVoidBeast.class, "voidbeast", 64, 3, true); } private static int entityID = 0; private static void registerEntity(Class<? extends Entity> entityClass, String entityName, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) { EntityRegistry.registerModEntity(entityClass, entityName, entityID++, Ref.MODID, trackingRange, updateFrequency, sendsVelocityUpdates, 1, 1); }
  13. yeah but it will only fire once cause any item of that type that doesn't have a tag will get one on the first tick public void onUpdate(ItemStack item, World world, Entity player, int itemSlot, boolean isSelected) { if (!item.hasTagCompound()) { item.setTagCompound(new NBTTagCompound()); this.setDamage(item, 2000); item.getTagCompound().setInteger("power", 2000); item.getTagCompound().setBoolean("active", false); } and i use on update for other things so not like its not ticking anway
  14. just staring at the same code too long, that makes sense added a !item.hasTagCompound() check to the update tick and did the setup in their works great now
  15. Having a problem with item nbt. i setup the item with onCreated, then when i go to get something from the nbt with onItemRightClick it null points any ideas? Crash at item.getTagCompound().getInteger("power") <= 1900; public void onCreated(ItemStack item, World worldIn, EntityPlayer playerIn) { item.setTagCompound(new NBTTagCompound()); this.setDamage(item, 2000); item.getTagCompound().setInteger("power", 2000); item.getTagCompound().setBoolean("active", false); } public ActionResult<ItemStack> onItemRightClick(ItemStack item, World world, EntityPlayer player, EnumHand hand) { if (item.getTagCompound().getInteger("power") <= 1900 && !item.getTagCompound().getBoolean("active")) { item.getTagCompound().setBoolean("active", false); this.setDamage(item, (int) (this.getDamage(item) +(100))); item.getTagCompound().setShort("power", (short) this.getDamage(item)); player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 100)); return new ActionResult(EnumActionResult.SUCCESS, item); } else if (!item.getTagCompound().getBoolean("active")) { item.getTagCompound().setBoolean("active", false); player.removePotionEffect(MobEffects.NIGHT_VISION); return new ActionResult(EnumActionResult.SUCCESS, item); } return new ActionResult(EnumActionResult.FAIL, item); } https://github.com/Zerahi/RavenousVoid/blob/master/src/main/java/com/ravvoid/items/AwakenedVoidOrb.java
  16. just replaced the ref with a string and made a new object on each check with a switch for string name to new entity output and no crashes
  17. makes sense, i had just went of the furnace recipe list, still kinda new to modding, thanks both of you
  18. yeah i see that now, what would be the best way to refer to an entity so i can spawn one of that type later, EntityRegistry? or just store the entity.class
  19. changed to EntityVoidBeast extends EntityMob, no change
  20. its not null ever its only triggered if the Ref.altarlisttier1(this.display) != null; and mob spawns fine from a spawn egg no crash package com.ravvoid.entity.mob; import com.google.common.base.Predicate; import com.ravvoid.Ref; import javax.annotation.Nullable; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIAttackMelee; import net.minecraft.entity.ai.EntityAIFollowParent; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAIPanic; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.datasync.DataParameter; import net.minecraft.network.datasync.DataSerializers; import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.util.DamageSource; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.World; import net.minecraft.world.storage.loot.LootTableList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class EntityVoidBeast extends EntityAnimal { public EntityVoidBeast(World world) { super(world); this.setSize(0.9F, 1.1F); } /** * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on * the animal type) */ public boolean isBreedingItem(ItemStack stack) { return false; } protected void initEntityAI() { super.initEntityAI(); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIAttackMelee(this, 1.0D, false)); this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(4, new EntityAILookIdle(this)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(15.0D); this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(20.0D); this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE); this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.0D); } protected SoundEvent getAmbientSound() { return SoundEvents.field_190026_er; } protected SoundEvent getHurtSound() { return SoundEvents.field_190029_eu; } protected SoundEvent getDeathSound() { return SoundEvents.field_190028_et; } protected void playStepSound(BlockPos pos, Block blockIn) { this.playSound(SoundEvents.field_190030_ev, 0.15F, 1.0F); } @Nullable protected ResourceLocation getLootTable() { return Ref.VOIDBEAST; } /** * (abstract) Protected helper method to read subclass entity data from NBT. */ public void readEntityFromNBT(NBTTagCompound compound) { super.readEntityFromNBT(compound); } /** * (abstract) Protected helper method to write subclass entity data to NBT. */ public void writeEntityToNBT(NBTTagCompound compound) { super.writeEntityToNBT(compound); } public boolean attackEntityAsMob(Entity entityIn) { boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), (float)((int)this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue())); if (flag) { this.applyEnchantments(this, entityIn); } return flag; } @Override public EntityAgeable createChild(EntityAgeable ageable) { // TODO Auto-generated method stub return null; } }
  21. whenever i spawn the entity it crashes the client, then when i restart it entity is in world where it should be like nothing happened, any idea why its crashing? if(!worldObj.isRemote) { Entity spawn = null; spawn = Ref.altarlisttier1(this.display); spawn.setWorld(worldObj); EntityLiving entityliving = spawn instanceof EntityLiving ? (EntityLiving)spawn : null; spawn.setLocationAndAngles(pos.getX(), pos.getY()+1.25f, pos.getZ(), worldObj.rand.nextFloat() * 360.0F, 0.0F); AnvilChunkLoader.spawnEntity(spawn, worldObj); worldObj.playEvent(2004, pos, 0); if (entityliving != null) { entityliving.spawnExplosionParticle(); } } Description: Ticking entity java.lang.NullPointerException: Ticking entity at net.minecraft.entity.ai.EntityAITasks.onUpdateTasks(EntityAITasks.java:64) at net.minecraft.entity.EntityLiving.updateEntityActionState(EntityLiving.java:846) at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2392) at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:643) at net.minecraft.entity.EntityAgeable.onLivingUpdate(EntityAgeable.java:178) at net.minecraft.entity.passive.EntityAnimal.onLivingUpdate(EntityAnimal.java:47) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2218) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:342) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2106) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:872) at net.minecraft.world.World.updateEntity(World.java:2073) at net.minecraft.world.World.updateEntities(World.java:1886) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:644) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:783) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536) at java.lang.Thread.run(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at net.minecraft.entity.ai.EntityAITasks.onUpdateTasks(EntityAITasks.java:64) at net.minecraft.entity.EntityLiving.updateEntityActionState(EntityLiving.java:846) at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2392) at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:643) at net.minecraft.entity.EntityAgeable.onLivingUpdate(EntityAgeable.java:178) at net.minecraft.entity.passive.EntityAnimal.onLivingUpdate(EntityAnimal.java:47) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2218) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:342) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2106) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:872) at net.minecraft.world.World.updateEntity(World.java:2073) -- Entity being ticked -- Details: Entity Type: rv.voidbeast (com.ravvoid.entity.mob.EntityVoidBeast) Entity ID: 0 Entity Name: Void Beast Entity's Exact location: 237.00, 70.25, 303.00 Entity's Block location: World: (237,70,303), Chunk: (at 13,4,15 in 14,18; contains blocks 224,0,288 to 239,255,303), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Entity's Momentum: 0.00, 0.00, 0.00 Entity's Passengers: [] Entity's Vehicle: ~~ERROR~~ NullPointerException: null Stacktrace: at net.minecraft.world.World.updateEntities(World.java:1886) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:644) -- Affected level -- Details: Level name: New World All players: 1 total; [EntityPlayerMP['Player368'/314, l='New World', x=231.35, y=69.00, z=301.42]] Chunk stats: ServerChunkCache: 639 Drop: 0 Level seed: 9049979599259575510 Level generator: ID 00 - default, ver 1. Features enabled: true Level generator options: Level spawn location: World: (256,64,256), Chunk: (at 0,4,0 in 16,16; contains blocks 256,0,256 to 271,255,271), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 12466 game time, 12466 day time Level dimension: 0 Level storage version: 0x04ABD - Anvil Level weather: Rain time: 87931 (now: false), thunder time: 115727 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true Stacktrace: at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:783) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536) at java.lang.Thread.run(Unknown Source) -- System Details -- Details: Minecraft Version: 1.10.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_91, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 456852240 bytes (435 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94 FML: MCP 9.32 Powered by Forge 12.18.1.2011 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10.2-12.18.1.2011.jar) UCHIJAAAA Forge{12.18.1.2011} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2011.jar) UCHIJAAAA rv{1.10.2} [Ravenous Void] (bin) Loaded coremods (and transformers): GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread. Profiler Position: N/A (disabled) Player Count: 1 / 8; [EntityPlayerMP['Player368'/314, l='New World', x=231.35, y=69.00, z=301.42]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge' https://github.com/Zerahi/RavenousVoid/blob/master/src/main/java/com/ravvoid/tileentity/TileEntityAltar.java
  22. and right after fixing i look around and see about 100 of them i had spawned while testing lol
  23. oh yep see it now, thanks a bunch
  24. Making a custom mob and everything works, can spawn it with egg, it moves around. When it moves more than 5 feet from me or if i hit it, it stops rendering. the entity still exists and can hit me, and will show back up randomly but no idea what i did wrong. i also have a model made and textures work in game, and an entity setup, if you need any more info let me know. RenderingRegistry.registerEntityRenderingHandler(EntityVoidBeast.class, RenderVoidBeast::new); @SideOnly(Side.CLIENT) public class RenderVoidBeast extends RenderLiving { private static final ResourceLocation VOIDBEASTTEXTURE = new ResourceLocation("rv:textures/models/voidbeast.png"); public RenderVoidBeast(RenderManager renderManagerIn) { super(renderManagerIn, new ModelVoidBeast(), 0.7F); } protected ResourceLocation getEntityTexture(Entity entity) { return VOIDBEASTTEXTURE; } public static void registerEntities() { registerEntity(EntityVoidBeast.class, "Void Beast", 64, 1, true); } private static int entityID = 0; private static void registerEntity(Class<? extends Entity> entityClass, String entityName, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) { EntityRegistry.registerModEntity(entityClass, entityName, entityID++, Ref.MODID, updateFrequency, updateFrequency, sendsVelocityUpdates, 1, 1); }
  25. that and it didn't like me adding the spawn entity in the nbt code, so i added itickable to check if it has an item and spawn and entity if none exists, all working perfectly now thanks a bunch
×
×
  • Create New...

Important Information

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