Jump 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.

zedblade

Members
  • Joined

  • Last visited

Everything posted by zedblade

  1. Hello, I Need to destroy/remove/delete the current item in hand after right click event ... How can i do?
  2. Trying this works only with WOLF but LightingBolt wont works not even manually: Any ideas?
  3. package com.sapphire.items; import com.sapphire.main.mainRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.world.World; import net.minecraft.entity.player.EntityPlayer; public class sapphireIngot extends Item{ public sapphireIngot(){ super(); this.setCreativeTab(SapphireItems.sapphireTab); this.setMaxStackSize(1); } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister reg){ this.itemIcon = reg.registerIcon("sapphire:sapphire"); } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { //String var1 = "/summon LightningBolt ~1 ~1 ~1"; String var1 = "/summon Wolf ~1 ~1 ~1"; MinecraftServer.getServer().getCommandManager().executeCommand(player, var1); player.playSound("mob.wolf.death", 1.0F, 1.0F); return itemStack; } } Instead trying summon the wolf it works but says however "not permission" ... o_O
  4. thanks for the quick reply, but it says "You do not have permission to use this command". I'm in creative mode with option "allow cheats" ON ... What's up? PS The command is: "/summon LightningBolt ~1 ~1 ~1"
  5. I need to run a command type "/summon ..." from right click item event. I had a look to net.minecraft.command.CommandBase and net.minecraft.tileentity.TileEntityCommandBlock library but nothing to do... Can someone help me? thx
  6. there's quite large topic about custom packets - http://www.minecraftforge.net/wiki/Packet_Handling yes i know but i really need a specific example to how tell to server when the button is pressed and then make the block change
  7. Yes, but i cant found a specific tutorial to do it. (If you have one can you show me?) on wiki i found very roughly guide line to handle the packet.
  8. check than modid, modname and channel have the same name
  9. No, the block-replacing code should run both client & server. the mymod.ReplaceBlock = true everytime the player press OK on a GUI mask
  10. seems cant run updatetick function: also I added setRequiresSelfNotify as in wheat (you mean BlockCorp, right?) but wont work.
  11. oh god, i put it in randomDisplayTick because previously it was in GUIscreen button (cliente side only too). In fact the boolean mymod.ReplaceBlock = true when pressed OK button from a GUI ... Now I really dont know where i can put that code. :'( any suggestion?
  12. Yes, i tried but unfortunately the problem happen also in SSP (client side). Also I tried using this: MinecraftServer mcServer = MinecraftServer.getServer(); mcServer.worldServerForDimension(player.dimension).setBlockWithNotify(X, Y, Z, mymod.mymod.blockID); or mcServer.worldServerForDimension(player.dimension).setBlock(X, Y, Z, mymod.mymod.blockID); but mc give me "java.lang.NullPointerException". I dont know why ...
  13. Hello everyone, I made a mod than replace a block with another own block, by right-clicking on it, with the follow function: This work fine in SSP but in SMP the block seems replaced but when I reload the chunk or I right-click the block, this return back to the previous block. as if nothing had happened. Now i know than i need to send to the server a custom package to notify the changes, and i've made the ServerPacketHandler class: And i initialized it in main mod class declaration network section: Now i dont know what i must put into ServerPacketHandler or into right-click event to notify the replaced block to the server. Plese any suggestions ...
  14. Yes, i need to modify the stackTagCompound only when is pressed OK button on the GUI, now i know GUI = client but absolutely I need to ask to the player some informations to be stored into his item. Then i need a sample to how send a package from GUI button action to server ...
  15. Hello, I have an issue server side when i try to change the stackTagCompound of my item by a GUI. From Item RightClick event I open the GUI: par3EntityPlayer.openGui(mymod.instance, mymod.myGuiID, par2World, 0, 0, 0); And from GUI I assign a name & an array to the stackTagCompound of my Item: Seems go all ok but when i read again the stackTagCompound data i found nothing! I guess i need to send data to the server side but how? Please help.
  16. You are AWESOME!!! my ModID into @instance("MyMod") was wrong!!! Now the Gui is open but can't play the sound in it: varWorld.playSoundEffect(var10 + 0.5D, var11 + 1.0D, var12 + 0.5D, "mob.blaze.death", 1.0F, 1.0F); won't play... Also the line into the Gui don't work anymore: varWorld.setBlockWithNotify(X, Y, Z, mymod.myblockID); Seems a server notify issue ...
  17. this is my main mod class: GuiHandler class: Line into my_item right_click event:
  18. Sure, I also tried that. But occurs another error: "A mod tried to open a gui on the server without being a NetworkMod" And this wont work. Into main mod class file it's declared this: @NetworkMod( clientSideRequired = true, serverSideRequired = false, channels = {"MyMod"}, packetHandler = ServerPacketHandler.class ) Into my_item right_click event there was: par3EntityPlayer.openGui(mymod.instance, mymod.myGuiID, par2World, (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ); Please anyone can show me a working example of gui open on the server side???
  19. Well, I tried your method but still happen same error: FMLCommonHandler.instance().showGuiScreen(new GuiHandler().getClientGuiElement(mymod.myGuiID1, par3EntityPlayer, par2World, (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ)); Also I tried using FMLClientHandler: FMLClientHandler.instance().showGuiScreen(new GuiHandler().getClientGuiElement(mymod.myGuiID1, par3EntityPlayer, par2World, (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ)); Error: Exception in server tick loop java.lang.NoClassDefFoundError: mymod/myGui1 at mymod.ClientProxy.openClientGui(ClientProxy.java:28) This is the HandlerGui code: ClientProxy code: CommonProxy code:
  20. how? I open the GUI from my_item right_click event ...
  21. Yes, i've both ClientProxy and CommonProxy. I literally followed any mod guide line. And my 3 GUI aren't container GUI. But the error still happen. There must be something wrong into the @NetworkMod declaration. This my main mod class code: Proxies: And This is GuiHandler code:
  22. Ok, thank you for reply. I've replace the line 189 with this: par3EntityPlayer.openGui(mymod.instance, 1, par2World, (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ); But when i try to open the gui: "A mod tried to open a gui on the server without being a NetworkMod" my mod has 3 different gui classes but i dont know how to declare or refer the IDs Into main class file it's declared this: @NetworkMod( clientSideRequired = true, serverSideRequired = false, channels = {"MyMod"}, packetHandler = ServerPacketHandler.class ) Any suggestion?

Important Information

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

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.