Everything posted by zedblade
-
[1.7.10] Destroy an item
Hello, I Need to destroy/remove/delete the current item in hand after right click event ... How can i do?
-
[1.7.10] Running a commad by code
Trying this works only with WOLF but LightingBolt wont works not even manually: Any ideas?
-
[1.7.10] Running a commad by code
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
-
[1.7.10] Running a commad by code
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"
-
[1.7.10] Running a commad by code
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
-
Server-Client sync package notify
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
-
Server-Client sync package notify
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.
-
Server-Client sync package notify
bump
-
[Solved]GUI Problems
check than modid, modname and channel have the same name
-
Server-Client sync package notify
No, the block-replacing code should run both client & server. the mymod.ReplaceBlock = true everytime the player press OK on a GUI mask
-
Server-Client sync package notify
seems cant run updatetick function: also I added setRequiresSelfNotify as in wheat (you mean BlockCorp, right?) but wont work.
-
Server-Client sync package notify
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?
-
Server-Client sync package notify
As you wish:
-
Server-Client sync package notify
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 ...
-
Server-Client sync package notify
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 ...
-
Sync Server-Client item stackTagCompound changes
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 ...
-
Sync Server-Client item stackTagCompound changes
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.
-
[Solved] Server crash java.lang.NoClassDefFoundError: GUIScreen
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 ...
-
[Solved] Server crash java.lang.NoClassDefFoundError: GUIScreen
this is my main mod class: GuiHandler class: Line into my_item right_click event:
-
[Solved] Server crash java.lang.NoClassDefFoundError: GUIScreen
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???
-
[Solved] Server crash java.lang.NoClassDefFoundError: GUIScreen
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:
-
[Solved] Server crash java.lang.NoClassDefFoundError: GUIScreen
how? I open the GUI from my_item right_click event ...
-
[SOLVED] Server side crash, java.lang.NoClassDefFoundError: mymod/myGui
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:
-
[SOLVED] Server side crash, java.lang.NoClassDefFoundError: mymod/myGui
bump Some(great)body can help me?
-
[SOLVED] Server side crash, java.lang.NoClassDefFoundError: mymod/myGui
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?
IPS spam blocked by CleanTalk.