Everything posted by ShaneCraft
-
1.7 Lock Entity's rotation jaw and pitch
No, this is not what I am trying to do, to address what I want to create is best shown in this video: I want to affect all entities of EntityLiving(Base) to be looking at the thrower, in this video the entity is controlling the player's rotation jaw and pitch to be looking at the x,y,z and the eyeheight of this entity.
-
1.7 Lock Entity's rotation jaw and pitch
Hi, I've created a 'potion'entity which affects every entity with an instance of entityliving(base), which works fine, until EntityBodyHelper is getting called. EntityBodyHelper creates the random rotation jaw and pitch and is overriding my potions. I want my entities to have a locked rotation jaw and pitch until the potion wears off (make the entity look at the thrower). Currently I am using an exact copy of EntityLookHelper, but it takes entities with an instance of EntitylivingBase instead of EntityLiving (so I can affect EntityPlayer as well) and is not reliable of having AI enabled (it gets updated when the potion is active). Does anyone maybe have a better solution? All I can think of at the moment is to remove the affected entity's AI and add them back in when the potion is about the wear off, but that makes the entities 'freeze' if their walking is based on an ai task.
-
[1.7.2]Pre-Enchanted Items?
you can return an itemstack in a crafting recipe, so you can just append the enchantment on that itemstack and then return it. return itemstack.addEnchantment([your enchantment], [your level of the enchantment]);
-
[1.6.4]CCTV/ Track the sight of an entity
I expect 1.8 to be near, if you're willing to wait, the source code of a entityplayer rightclicking an entity in gamemode 3 can take the viewing point of that entity will be available. Else I suggest looking in the EntityRender/EntityRenderer(not sure how it's called) class.
-
Two GUI's
you can only display 1 gui, however you can load up as many inventories on 1 screen that you want, it that's what you're after?
-
How to render an Entity to be on fire?
Something tells me you didn't try that hard to find it. Render#renderEntityOnFire(Entity entity, double coordX, double coordY, double coordZ, float scale) this method is private, just copy it over to your entityrender class. the scale is not being used, so you can leave that out of the parameters. add it to your render class's doRender method.[/code]
-
[1.7.2]Can't get mob form list.
I wouldn't check for entities on the client world though. Entity entity; World world = //find some way to initialize the world in your tickhandler without using Minecraft.getMinecraft().theWorld; if(!world.isRemote) { List list = world.getEntitiesWithinAABB(EntityItem.class, this._golem.boundingBox.expand(20.0D, 4.0D, 20.0D)); EntityItem entityitem = null; Iterator iterator = list.iterator(); while (iterator.hasNext()) { EntityItem entityitem1 = (EntityItem)iterator.next(); entity = entityitem1; break; } }
-
[1.7.2]Create new horse armor
The container slot for the armor of a horse only accepts items which are defined in the horse's class. (func_146085_a in 1.7.2). You could create a new entity class and make it extend EntityHorse and override that one function. They should've created a new item class called ItemHorseArmor and let the armorslot check if the item the player tries to enter into it is an instance of ItemHorseArmor. It saves some unnecessary checks in both entityhorse and containerhorseinventory.
-
[1.7.2] Get hovered stack in inventory
In GuiContainer there is a method called: isMouseOverSlot which takes a slot and a 2d vector of your mouse position(x and y). But unfortunately that method is private. You could write your own method though. private Container _container; private ItemStack _itemStack; private Minecraft _mcClient; private int _height; private int _width; //constructor: public YOURCLASS(){ _container = null; _itemStack = null; _mcClient = FMLClientHandler.instance.getClient(); /* Somehow initialize _height and _width from the player's active guiscreen. _height = ? _width = ? */ } public ItemStack getItemStack(){ if(this._mcClient != null) { _container = this._mcClient.thePlayer.openContainer; int mouseX = Mouse.getEventX() * this.width / this.mc.displayWidth; int mouseY = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; for (int i = 0; i < _container.inventorySlots.inventorySlots.size(); ++i){ Slot slot = (Slot)_container.inventorySlots.inventorySlots.get(i); if (this.isMouseOverSlot(slot, mouseX, mouseY, _width, _height) && slot.func_111238_b()){ return this._itemStack = slot.getItemStack(); } } } } public boolean isMouseOverSlot(Slot slot, int xCoord, int yCoord, int guiLeft, int guiTop){ int left = guiLeft; int top = guiTop; xCoord -= top; yCoord -= left; return xCoord >= slot.xDisplayPosition - 1 && xCoord < slot.xDisplayPosition + 16 + 1 && yCoord >= slot.yDisplayPosition - 1 && yCoord < slot.yDisplayPosition + 16 + 1; }
-
[1.7.2]Need help with finding a client side version of blockBreakEvent
Minecraft SSP is server based, but instead of sending the data to a network, it will be send locally (loopback). http://en.wikipedia.org/wiki/Loopback
-
How to display tooltips in inventory
Try to be more specific please, Do you want to have an object in your gui that will display a tooltip when hovered over? All code is already in the game, search for something as renderToolTip in GuiScreen or GuiContainer.
-
Having an entity check for a Blocks Metadata
I will edit or reply when i am on my machine with the source, i've done it for my entity that collects items based on nbt and metadata. This snippet is an example of my ai, it checks if the nbt and metadata are the same. (mine is controlled by a boolean though)
-
Problems adding new functional slots to custom furnace
I suggest you to learn more java first. You need a separate timer for your other 3 slots...
-
Having an entity check for a Blocks Metadata
if (par2ItemStack != null && par2ItemStack.getItem() instanceof ItemCloth){ system.out.println(par2ItemStack.getItemDamage());
-
Having an entity check for a Blocks Metadata
Finding an actual placed block's meta data? i think it's World.getMetaFromBlock(x,y,z) not sure, else if you're looking for an itemblock you have to check the itemdamage, if itemdamage of block.double_plant returns 1, it should be the one you're looking for.
-
Custom Sword That Shoots Ender Pearls Turns Into An Ender Pearl
Well, you're here to learn and advance, but you could just look at the source in net.minecraft.item package.
-
Custom Sword That Shoots Ender Pearls Turns Into An Ender Pearl
Why are you setting an object(itemstack please) of this instance? Just return the itemstack parameter in onItemRightClick
-
[1.7.2] Custom mob render with item failure
Here.. Mess around with the opengl to make the items fit to your liking.
-
Problems adding new functional slots to custom furnace
But you're not calling anything beyond furnaceItemStacks[2]; 4th slot = furnaceItemStack[3] 5th slot = furnaceItemStack[4] 6th slot = furnaceItemStack[5] Nowhere in your code you're telling it to be that slot. Heck, you're not even calling those itemstacks at all. So nothing is going to work. If you want to have 2 furnaces in 1, you can just copy everything containing furnaceItemStack[0] (1st slot) and replace 1 with 3(4th slot) to what you've copied. DONE!
-
Problems adding new functional slots to custom furnace
You don't do anything with the other indexes of your tileentity's ItemStack array furnaceItemstacks. What did you expect to happen? Your tileentity only calls slot 0 through 2, you never used 3 through 5. There is no error in your code, there just is no code for your other slots.
-
Problems adding new functional slots to custom furnace
Your tileentity and container classes are missing. container for the inventory slots and tileentity for the actions.
-
[1.7.2] Custom mob render with item failure
You can find the correct snippet in RenderWitch. You would have to fiddle around with the rotation and position of the rendered item though.
-
[1.7.2] Making the gravity like Mars.
In some ticking method; int dimension = YOUR_DIMENSION_ID; World world = DimensionManager.getWorld(dimension); if (world==null) return; List list = world.loadedEntityList; for(Iterator<EntityLiving> entity = list.iterator(); entity.hasNext(){ EntityLiving living = entity.next(); living.jumpMovementFactor = ??;//I haven't worked with this before, but should be able to help you out, I guess. }
-
[1.7.2]Changing AI using a boolean
1. does your ai even work? 2. remove all other ai's you have set in your mob's constructor eg wander ai. this most definitely will cause a conflict. 3. you add a task when the entity has bombed with the id being a value of 4, but before you remove the previous one, there is already a task with that id present. I haven't used updateAITasks, I would rather set hasBombed to true in the ai, save it in a nbttagcompound and make the ai run if hasBombed is false. private boolean _hasBombed; public void setHasBombed(boolean flag) { _hasBombed = flag; this.switchTasks(flag); //might be usefull if it has to run instantly after it has bombed. } public boolean hasBombed() { return _hasBombed } @Override public void writeEntityToNBT(NBTTagCompound nbttc) { super.writeEntityToNBT(nbttc); nbttc.setBoolean("HasBombed", this.hasBombed()); } @Override public void readEntityFromNBT(NBTTagCompound nbttc) { super.readEntityFromNBT(nbttc); this.setHasBombed(nbttc.getBoolean("HasBombed")); } you can now just call ((EntityMiniBomber)entity).setHasBombed(true) in your ai class.
-
[1.7.2][solved] Gui not recognizing specific variable of entity!
Fixed it, close thread.
IPS spam blocked by CleanTalk.