• 1

    posted a message on Event issues

    I think issue is using player method to try to cancel the event.

    also not sure if player.isEating() will return true at the point this is called.

    event.setCanceled(true); works have tested bellow code with 1.7.10


    @SubscribeEvent
    public void eatFish(PlayerUseItemEvent.Start event){
    Item item = event.item.getItem();
    if(item == Items.fish || item == Items.cooked_fished){
    event.setCanceled(true);
    }
    }

    Posted in: Modification Development
  • 1

    posted a message on [SOLVED] Block right click with item

    if(player.capabilities.isCreativeMode)

    Posted in: Modification Development
  • 1

    posted a message on [1.7 & 1.8] TheXFactor117's Forge Modding Tutorials | 20+ Tutorials | Actually Learn How to Make Mods!
    Quote from cocorj070»

    Thanks for the help!


    Although the "ModName.instance" is still an error,

    ^ (I did replace my Modname in there)

    l

    Am I missing something? It feels like a I skipped a part of the tutorial :P


    Actually it looks like Brockstar01 is having the same issue as me, is the tutorial missing something?


    Points to a variable you have to set up in your Main Class like this


    @Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)

    public class YourMainClassName{

    @Instance(Reference.MODID)
    public static YourMainClassName instance;

    @Mod.EventHandler
    public void preInit(FMLPreInitializationEvent event){//init events below

    Posted in: Mapping and Modding Tutorials
  • 1

    posted a message on [SOLVED] Block right click with item
    Quote from WolfieWaffle»

    2. If I wanted to check if the player is holding a certain block, how would I do that? getBlock()? This code gives me the error, "The method getBlock() is undefined for the type ItemStack"


    If you want to get a block from Item you should use if(Block.getBlockFromItem(player.inventory.getCurrentItem().getItem()) == Blocks.whatever_block)

    OR

    if(player.inventory.getCurrentItem().getItem() == Item.getItemFromBlock(Blocks.whatever_block)) to get Item from Block

    sorry not sure what the 3 floats are but the integer will be Block Metadata

    Posted in: Modification Development
  • 1

    posted a message on [SOLVED] Block right click with item

    player.inventory.getCurrentItem() returns an itemstack your checking for an item so you want to add .getItem() to get an Item from an ItemStack


    if(player.inventory.getCurrentItem().getItem() == items.flint)

    Posted in: Modification Development
  • 1

    posted a message on [SOLVED] Method for updating a tile entity from its corresponding GUI.

    pass the tile entity to the GUI on calling it


    add this to class


    private TileEntity tileent;


    public GUIPointer(TileEntity entity)
    {
    this.tileent = entity;

    }


    then you have access to the tileentity and can just use tileent.xCoord ect presuming you already know how to then send update packet to server. Otherwise you now want to look into packet handling client to server.

    Posted in: Modification Development
  • 1

    posted a message on Is Minecraft dead?
    Quote from Mooncrefter»

    I don't think the cancerous part of the Minecraft fanbase is going anywhere anytime soon. In fact, I've seen a lot of long time Minecraft fans stop playing because the game has changed way too much, which concerns me a little.


    If their issue was changes in new updates why not play the older version i pretty much strictly play 1.7.10 and on 1.7.10 servers but i know there are still a few servers out there still running earlier versions and in single player you have access to almost all older versions.

    Posted in: Discussion
  • 1

    posted a message on [1.7 & 1.8] TheXFactor117's Forge Modding Tutorials | 20+ Tutorials | Actually Learn How to Make Mods!

    I notice at least one typo in recipes files ("X" as input but 'x' to declare what that item is).


    en_AU Australia

    en_CA Canada

    en_GR Britian

    en_PT Pirate (??)


    here is reference

    http://minecraft.gamepedia.com/Language?cookieSetup=true

    Posted in: Mapping and Modding Tutorials
  • 1

    posted a message on [1.7 & 1.8] TheXFactor117's Forge Modding Tutorials | 20+ Tutorials | Actually Learn How to Make Mods!
    Quote from baldwhin»

    That's what I have.


    yeah so instead of



    @EventHandler
    public static void PreLoad (FMLPreInitializationEvent PreEvent) {
    McreativeTabs.initializeTabs();
    Mblocks.mainRegistry();
    Mitems.mainRegistry();
    Mworld.mainRegistry();
    CraftingManager.mainRegistry();
    proxy.registerRenderInfo();
    }
    @EventHandler
    public static void load (FMLInitializationEvent event) {

    }


    you want



    @EventHandler
    public static void PreLoad (FMLPreInitializationEvent PreEvent) {
    McreativeTabs.initializeTabs();
    Mblocks.mainRegistry();
    Mitems.mainRegistry();
    Mworld.mainRegistry();
    proxy.registerRenderInfo();
    }
    @EventHandler
    public static void load (FMLInitializationEvent event) {
    CraftingManager.mainRegistry();
    }

    Posted in: Mapping and Modding Tutorials
  • 2

    posted a message on [SOLVED] Trying to add Potion Effects to Blocks on Collision

    Ok Both of these are working for me


    public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity entity) {
    ((EntityPlayer) entity).addPotionEffect(new PotionEffect(Potion.blindness.id, 1000, 4));
    System.out.print("Called");
    }
    public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer player) {
    player.addPotionEffect(new PotionEffect(Potion.blindness.id, 1000, 4));
    System.out.print("Called");
    }

    Posted in: Modification Development
  • To post a comment, please or register a new account.