Skip to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Animefan8888

Forge Modder
  • Joined

  • Last visited

Everything posted by Animefan8888

  1. Is block/half_slab a block json? Yes it is, the vanilla slabs use it as well Is the json in modid:block/json Should it have to be in my mods assets folder, if I reference it from it's vanilla location, because that makes no sense to me, as I have done this with other models that worked fine I meant yours not the vanilla i should have specified.
  2. Is block/half_slab a block json? Yes it is, the vanilla slabs use it as well Is the json in modid:block/json
  3. Is block/half_slab a block json?
  4. I think you could the containerItem var or custom IRecipe.
  5. None of the block break methods have any ItemStack param, so I presume in getDrops I return a list of ItemStacks containing a custom ItemStack which has the NBT of the TE? Does getDrops have a world parameter?
  6. The difference is between using ModelLoader.setModelResourceLocation(item, meta, location) and Minecraft::register(item, meta, location). The prior will get called in preInit and the later after preInit. The later is also really finicky about what happens before/after so stick with ModelLoader version.
  7. In preInit after registration or before? I dont think it matters.
  8. Then you will have to use a custom capability or maybe an IProperty I personally have not worked with either of these, but im pretty sure you want to use the later.
  9. Instead of having the code for the effect in onItemRightClicked have it in onPlayerStoppedUsing (i believe it was that name may have changed). For an example of this look at ItemBow.
  10. Interactions happen with TileEntities not Containers atleast with hoppers.
  11. If this is still a problem i would recommend looking at my video tutorial if you think it might help. I mess up little on the JSON still getting used to them...
  12. Mod tweaker reads from a script at runtime and doesn't change dynamically.
  13. Are you adding the button outside of the gui?
  14. Can we see the updated whole class?
  15. Yes I know, and I can do pretty much the same for HeldEquippment, but is there a specialized method for doing that? Something like InventoryPlayer#hasItemStack which tries to see if an ItemStack instance exits in player's inventory, except returning a boolean it would return an inventory slot position. No you will have to create that method yourself.
  16. That's why I store some of the data in the upper part, some of the data in the middle part and the rest of the data in the lower part. Each part knows its height/position and fetches the things it doesn't store itself from the other parts. Just as vanilla doors do (they have HALF, FACING, HINGE and OPEN resulting in 32 possibilities). That worked fine in the 1.9 version and works on vanilla doors, so that's not the cause of the problem. Ok but vanilla doors only have two halfs 2 * 4 (the facing) * 2 (open or closed) = 16 which is the exact number for metadata. How ever yours would have more than thirteen so i would make three different blocks one for each part of the door atleast for your 1 by 3 door otherwise you will need a TileEntity.
  17. Move them up 0.0001 or similar amount.
  18. Has the forum stopped supporting 1.8 now?
  19. RenderingRegistry.registerEntityRenderingHandler (the render factory version) create a class that implements IRenderFactory then in the method that returns a Renderer (or something close to that return your renderer. If you dont have a renderer make on and in the render method from an instance of your model the render function.
  20. 100%. Below is the full code of the block class, and the only output I'm getting in the console is "Player collided! On server?: false" (and only once per collision, not twice like you'd expect from a server and client execution). package com.IceMetalPunk.amethystic.AmethysticBlocks; import java.util.Random; import com.IceMetalPunk.amethystic.Amethystic; import net.minecraft.block.Block; import net.minecraft.block.BlockFire; import net.minecraft.block.material.MapColor; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockEnderFlame extends BlockFire { public BlockEnderFlame() { super(); this.setUnlocalizedName("ender_flame").setRegistryName(Amethystic.MODID, "ender_flame"); } @Override public int tickRate(World worldIn) { return 10; } @Override public MapColor getMapColor(IBlockState state) { return MapColor.CYAN; } @Override // So the Ender Flame doesn't spread public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { Block block = world.getBlockState(pos.down()).getBlock(); int i = ((Integer) state.getValue(AGE)).intValue(); boolean flag = block.isFireSource(world, pos.down(), EnumFacing.UP); if (!flag && world.isRaining() && this.canDie(world, pos) && rand.nextFloat() < 0.2F + (float) i * 0.03F) { world.setBlockToAir(pos); } else if (i < 15) { state = state.withProperty(AGE, Integer.valueOf(i + 1)); world.setBlockState(pos, state, 4); world.scheduleUpdate(pos, this, this.tickRate(world) + rand.nextInt(10)); } else { world.setBlockToAir(pos); } } // Teleport the player when they walk through the flames with a linked // portkey @Override public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) { if (entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entity; ItemStack mainItem = player.getHeldItemMainhand(); ItemStack offItem = player.getHeldItemOffhand(); if (mainItem != null && mainItem.getItem() == Amethystic.items.PORTKEY && mainItem.hasTagCompound()) { NBTTagCompound tag = mainItem.getTagCompound(); int x = tag.getInteger("linkX"), y = tag.getInteger("linkY"), z = tag.getInteger("linkZ"); System.out.println("Player collided! On server?: " + !player.worldObj.isRemote); mainItem.damageItem(1, player); // FIXME: Damage only occurs on // client, not server? player.setPositionAndUpdate(x, y, z); player.setFire(1); } else if (offItem != null && offItem.getItem() == Amethystic.items.PORTKEY && offItem.hasTagCompound()) { NBTTagCompound tag = offItem.getTagCompound(); int x = tag.getInteger("linkX"), y = tag.getInteger("linkY"), z = tag.getInteger("linkZ"); offItem.damageItem(1, player); player.setPositionAndUpdate(x, y, z); player.setFire(1); } } } } Put a println before you do any if checks and just a suggestion use the logger system as it tells you whether it is server or client. Maybe the println does that but i dont remember it that way.
  21. In your renderer create an instance of your model and call render().
  22. I know...which is what I don't understand. As I said, the method that calls the item damaging has a debug output that prints player.isServerWorld(). Every output from that is true; i.e. it's only being called on the server (or at least it *is* being called on the server). And yet everything else regarding the damage suggests it's only being called on the client. How is it possible for isServerWorld (which just wraps !world.isRemote anyway) to return true but the next line of code to run only on the client? Just to clear it up !world.isRemote is server side and world.isRemote is client side. In the code above you return if !world.isRemote without doing anything in Item#onItemRightClick. And for the player.isServerWorld() println how are we supposed to know with out seeing updated code.
  23. If this isnt called when an entity is attacked by an item from the player there would be no point in the methods existence. PlayerControllerMp#attackEntity calls other methods figure out which one happens before resistance times are sent that are in the items class that give you the target then deal the damage there (hopefully without recursion).
  24. Ah, yes, that makes sense. Well, the actual amount of bonus damage still needs calibration, so I may end up recalculating based on the cooldown anyway. But first I need to figure out why it doesn't seem to be doing any bonus damage unless the amount is turned way, way up... *EDIT* Okay, odd...I threw in some debugging console logging, and it seems like target.attackEntityFrom() is returning false. Unfortunately, there are many reasons that would happen, so I guess it's time for me to step through and find out what's going on... *EDIT 2* Well...the importance of breakpoints, everyone. So it turns out the problem here is in hit-based resistance times. After getting hit, there's a small amount of time where an entity will only take damage if the attack is stronger than the previous attack. Since this attack is equivalent, and applied immediately after the first attack, it was being ignored by the resistance time. When I was testing with very high values, those were more than the "previous attack" strength, so it let them through. Okay, then. Now I have a place to start with fixing this. Time to see if I can actually reset the resistance timer in order to apply the second damage... *EDIT 3* If anyone's still reading this... So it turns out the resistance timer is a public member, so that was easy enough. However, in order to take cooldown into consideration, it introduces another problem: the bonus damage is triggering when the cooldown has just been reset from the normal attack, meaning it actually does no damage if cooldown is considered, and this code will only see a value of 0 for the cooldown no matter what. So is there a way to get the "previous cooldown", as it were? Or should I just be ignoring cooldown and having full bonus damage? (I thought about just dealing the equivalent of target.lastDamage, but that's also protected...I hope I won't have to hack my way through this via reflection...) I am currently wondering where entities are actually damage by the player now... the best way to figure this out would probably be to see where getDamageVsEntity() is called.
  25. The code you provided only attacks the enemy with the real attack damage + 1 (for both).

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.