Everything posted by Choonster
-
Item models don't render
There is no variant in your blockstates file called type=white , you need to use ison=true,type=white or ison=false,type=white instead. The name and value of the dummy property don't matter, but you used the wrong explanation as your dummy values. All of your variants have at least one property ( textures ), it's the fact that this first property was an object that was causing this issue.
-
Item models don't render
Your block models weren't working without a model in each variant of the blockstates file due to these limitations of Forge's blockstates format. The lamp_textures.json model does nothing and has no reason to exist, you should use the lamp.json model directly instead. The error you posted is unrelated to item models. Make sure your blockstates file accounts for the limitations linked above, run Minecraft again and post the actual errors for the item models (or the full FML log). Your post is mostly unrelated to the original topic, it probably should have been a new thread. Edit: And now it is.
-
[1.11] How to check if player's moving for a period of time?
At the end of a player tick ( TickEvent.PlayerTickEvent with TickEvent.Phase.END ), the Entity#prevPosX / Y / Z fields will have different values to the Entity#posX / y / z fields if the player moved that tick. If Entity#setPositionAndRotation was used to directly set the player's position, the fields will have the same value as each other. You should be using tick events rather than threads to schedule tasks. Minecraft is mostly single-threaded, so it's not safe to interact with normal classes from outside of the main client/server thread. Real time may not correspond directly to game ticks, especially if the server is lagging or paused. If a player schedules a teleport and then pauses the game, they wouldn't expect to be teleported while the game is paused. You may want to use the Capabiltiy System to store the timer for each player.
-
Where do I find some documentation to Minecraft mechanics?
If you can't find documentation, look at the implementation. MovementInputFromOptions#updatePlayerMoveState increments/decrements MovementInput#moveForward and MovementInput#moveStrafe based on which movement keys are pressed and then multiplies them by 0.3 if the sneak key is pressed. EntityPlayerSP#onLivingUpdate calls MovementInputFromOptions#updatePlayerMoveState and handles most player movement input (e.g. flying/sprinting toggles, flying vertical movement).
-
[1.11] Making basic command.
This is still accurate for (logical) server-side commands. For client-side commands, call CommandHandler#registerCommand on ClientCommandHandler#instance in preInit. Your command class should extend CommandBase , implement ICommand#execute , ICommand#getUsage and ICommand#getName . You can also override CommandBase#getRequiredPermissionLevel to return the required permission level and CommandBase#getTabCompletions to return the tab completion options.
-
MCP versions.json on Forge Maven doesn't contain latest mappings snapshot
The snapshot itself is actually on Forge's Maven here, despite not being in versions.json.
-
MCP versions.json on Forge Maven doesn't contain latest mappings snapshot
The MCPBot website and versions.json show that the latest snapshot for 1.11 is 20170122 , but the copy on Forge's Maven doesn't have this. The snapshot was generated approximately 18 hours ago (2017-01-22 03:00:01 EST), but the versions.json on Forge's Maven hasn't been updated. How often is it updated? Interestingly, I was able to use this snapshot in a different project approximately 11 hours ago (2017-01-22 09:55:00 EST) without issue.
-
AnimationModelBase for entities
AnimationModelBase requires that your Entity provides the CapabilityAnimation.ANIMATION_CAPABILITY capability. Forge's animation test mod has an example of this here.
-
[1.10.2] Block the use of certain weapons
I'm not sure that's possible. I can't see any event that would prevent EntityPlayerSP#swingArm being called in Minecraft#clickMouse .
-
[1.10.2] Block the use of certain weapons
AttackEntityEvent is a cancelable event fired when a player attacks an entity.
-
Advanced Collision Box
Override Block#addCollisionBoxToList (the instance method) for full control over your block's collision bounding boxes. Vanilla has several examples of this, e.g. BlockBrewingStand (two constant bounding boxes) and BlockStairs (up to three bounding boxes selected depending on the state). Create an AxisAlignedBB for each rectangular prism that can be collided with and store these in static final fields. In your Block#addCollisionBoxToList override, call Block.addCollisionBoxToList (the static method) for each of these AxisAlignedBB s to add it the list of collision bounding boxes. For a hot tub, you'll probably want an AABB for the base and one for each of the four walls.
-
How to connect to server directly
Use FMLClientHandler#connectToServer to connect to a server.
-
Any reason why reflection doesn't work in the exported mod?
Ahh, that makes sense. Thank you. Is there anywhere I can find the obfuscated/srg names for all the fields? Been searching for a while and can't find any documentation... Either look at the MCP mappings in the Gradle cache or use MCPBot.
-
Any reason why reflection doesn't work in the exported mod?
As I explain in this thread, vanilla fields and methods have multiple names. You need to check for both the SRG and MCP names when accessing a field/method through reflection. ReflectionHelper.findField and ReflectionHelper.findMethod make this easy by taking multiple names and trying each one until it finds the right one for the current environment.
-
[1.11.2]IItemPropertyGetter explanation request(Great Explanation inside)
IItemPropertyGetter allows you to specify properties (arbitrary float s) of an item based on the ItemStack , the current World (if any) and the EntityLivingBase that has the item (if any). The item model can query these properties and choose to render as a different model if they match certain values. The wiki explains the item model format here. An override predicate will be true when the IItemPropertyGetter for the specified property returns a value >= the value specified in the predicate. An override will only be used if all of its predicates are true . IItemPropertyGetter is mostly used for models that can change dynamically (e.g. pulling back a bow, casting a fishing rod, blocking with a shield or breaking an elytra). If your item has fixed subtypes you're probably better off using ItemMeshDefinition , which allows you to map an ItemStack to an arbitrary ModelResourceLocation . Make sure every possible ModelResourceLocation returned by the ItemMeshDefinition has been loaded by a blockstates file or ModelBakery.registerItemVariants . If you have a large number of similar variants, you could consider creating your own IModel like ModelDynBucket that generates the shapes and textures at runtime.
-
[1.11] Editing vanilla mobs?
EntityAIAttackRangedBow#attackCooldown controls the shooting speed of skeletons. AbstractSkeleton#setCombatTask is used to update this value when the skeleton is instantiated, read from NBT or spawned and when its main hand held item changes. I'm not sure if there's a good event to modify this from, since EntityJoinWorldEvent can be fired either before or after AbstractSkeleton#setCombatTask is called from AbstractSkeleton#onInitialSpawn and LivingSpawnEvent.SpecialSpawn will always be fired before it (and only for skeletons spawned passively or from a mob spawner). LivingEquipmentChangeEvent may work here. Arrow damage is based on the EntityArrow#damage field (this is set from EntityArrow#setEnchantmentEffectsFromEntity for skeleton arrows) and its velocity. You can use EntityJoinWorldEvent to detect an arrow being spawned, get the shooter from the EntityArrow#shootingEntity field and set the damage with EntityArrow#setDamage .
-
Default sound with custom subtitle
If you look at the vanilla sounds.json file, you'll see that minecraft:entity.egg.throw is a sound event rather than a sound file. You can use a sound event as a sound in your own sound event by setting the type field to "event" . The first sound of the minecraft:music.creative sound event is the minecraft:music.game sound event, you can look at this for an example. You can also just use the sound file used by minecraft:entity.egg.throw : random/bow[/code].
-
[1.11.2] ItemStack.loadItemStackFromNBT();
ItemStack.loadItemStackFromNBT was replaced by the ItemStack(NBTTagCompound) constructor.
-
Forge 1.11.2 Crashing upon launch. (Tried all methods to fix)
Your .minecraft directory is on a UNC path (hence the double backslash at the start of the path), which Forge doesn't support. You'll need to move the game directory to a local path to run Forge.
-
Chat Colors
EnumChatFormatting was renamed to TextFormatting at the same time IChatComponent was renamed to ITextComponent .
-
[1.10.2] Updating a players visual health
I see you're using my max health capability code. I never actually tested it across dimensions before now, but I can confirm that the client player's max health reverts to default when changing dimensions. To fix this, I subscribed to PlayerChangedDimensionEvent and used EntityTracker#sendToTrackingAndSelf to send an SPacketEntityProperties to all clients tracking the player. You can see this here.
-
[1.10] ExplosionEvent filters?
ExplosionEvent#getExplosion returns the event's Explosion . Explosion#explosionSize contains the Explosion 's size, but this is private (so you'll need to access it with reflection) and final (so you can't modify it). The only way to modify the strength of an explosion is to cancel ExplosionEvent.Start and create a new Explosion .
-
[1.11] Setting a Max Slot Size
Override IItemHandler#getSlotLimit .
-
Returning to modding what minecraft.mapping stable is for 1.11.2?
There currently isn't a stable MCP mappings version for 1.11.2, only snapshots. You can view all stable and snapshot versions on the MCPBot website, but it's down at the moment.
-
[SOLVED] [1.10.2] Errors compiling mod - cannot find symbol worldObj
In general Forge should work with any version of MCP mappings, so use either the Latest or Recommended version of Forge for the version of Minecraft you're using. snapshot_20161117 always causes this compilation error, use stable_29 instead. The stable version was generated a couple of hours after the snapshot and doesn't cause this error.
IPS spam blocked by CleanTalk.