Everything posted by GotoLink
- OnDeath
-
Liquid textures (1.6.2) Not working. [solved]
It is missing an animation metadata file.
-
Entity not rendering
Forgot to register the renderer ? Please, do: public final static ResourceLocation electricer = new ResourceLocation("brickcraft", "textures/models/electricer/ElectricerModel.png");
-
How can i make a airless block
Briggybros' idea could work fine, but might be a bit slow in multiplayer. Let's go all out, and do our own air counter (added in player data), and our own gui with drown bar (using RenderGameOverlayEvent). This way you can change whatever you want, from the air duration to the gui color.
-
Mob AI!
Then remove the player references in your code. As for AI, there is no place to learn that. You can read the AI classes from Minecraft, but an AI is mostly your own code anyway. You don't have to follow the vanilla AI system either.
-
OnDeath
You can add data to the zombies with IExtendedEntityProperties, then check for it in this event.
-
OnDeath
With the LivingDeathEvent: if(event.entityLiving instanceof EntityZombie)//allows subclass of EntityZombie or if(event.entityLiving.getClass() == EntityZombie.class)//more specific
-
Using IExtendedEntityProperties on multiplayer
Use a breakpoint on this line. I suspect playerNetServerHandler to be null.
-
Ideas for Fluid Coding
Well you said WorldReading was a World class. But seeing this method, it is just a utility class. So, I worried too much I would take a more object-oriented approach rather than this static method, but whatever floats your boat. You limit yourself to 6 sides when there is 26 neighbours to any given block by the way.
-
How can i make a airless block
I think there is a decreaseAirSupply(int) method in EntityLiving. You can use player ticks to check if the player is inside your block and call that method.
-
Ideas for Fluid Coding
Side sensitive functions... You don't understand the World class, do you ? Your flowing method should only do things on server side anyway. Add a check in it, or only call it server side.
-
Help not editing base classes
1. Client ticks, cache the current ressource pack and check it against every so often. 2. RenderLivingEvent.Specials events 3. KeyHandler for ease of use, Keyboard class for more advanced purposes.
-
Custom Block Fire Specific Damage
Search where Block.fire or DamageSource.inFire are called.
-
How To Make A Custom Modeled Mob Hold A Sword
It is also good practice to have lowercase package name, and to not use obfuscated names for your own fields and methods. Is your entity (with item or not) properly rendered ?
-
How to get the name of the world the player is in?
So: if(!world.isRemote) world.getWorldInfo().getWorldName()
-
Checking if a NBT exists?
If you have a specific nametag: if(tag.hasKey("mynametag"))
-
How do I debug a server side mod?
Check your imports. Sometimes the client only class is called here. Also check that you never do Minecraft.theWorld when in a common class.
-
Ideas for Fluid Coding
Let me pseudo code what I understand: if(gaz.meta<9){ BlockPosition block = gaz.getFreeNeighbour(); if(block!=null){ setMeta(new Gaz(block), 9); gaz.meta++; } } If i am right, the original block will indeed deplete and should only give a maximum of 9 gaz blocks with 100millibuckets.
-
Changing one item into another (not metadata)
See Wiki tutorials for PacketHandling Minecraft.getMinecraft().thePlayer returns a EntityClientPlayerMP
-
Generating Items in Chests
world.getBlockTileEntity(x,y,z); cast to IInventory, then setInventorySlotContents(int ,ItemStack);
-
Can you damage an item on smelting
Then override getContainer(ItemStack) by returning the itemstack, damaged as you want it to.
-
LivingAttackEvent
Fast answer: Switch player and entity in your code. Done. EntityLivingBase is a subclass of Entity by the way. Long answer: Check if attacked entity is a player instance, cast it, check for item held, if the desired one, do damage to entity attacking.
-
Ideas for Fluid Coding
I don't see how you can confuse 10 in millions within a single for loop. Anyway, i would assume that after you cut the block into pieces, you removed the original block, right ?
-
ItemStack.getItem() returning null
I would blame your getContents() returned array. By the way, there is a lot of chance that getQueen() would return null. Hopefully, you added some check for it before the two lines using it.
-
Changing one item into another (not metadata)
In your key handler: //perform item checks... Packet packet = new CustomPacket(data);//build a packet with data, like a boolean to switch between tiers and the player entityid to identify him player.sendQueue.addToSendQueue(packet);//send packet to the server In your packet handler: //handle the packet, read data, use it to check and perform changes... if(player instanceof EntityPlayerMP)//avoid endless loop { ((EntityPlayerMP)player).playerNetServerHandler.sendPacketToPlayer(packet);//send packet to the player client }
IPS spam blocked by CleanTalk.