Jump to content

Elrol_Arrowsend

Members
  • Posts

    182
  • Joined

  • Last visited

Everything posted by Elrol_Arrowsend

  1. Well the souls are stored on nbt. And that method is just so I can get the number of souls in the other methods. Is there a way to get the current held item in the getItemAttributeModifiers method?
  2. Well, while testing it seems like I found an issue, while I hold just one sword, it works perfectly, but if I have one sword that has 0 souls, and another with 1000, they both have the same attack and speed that was modified by the sword with 1000 souls. Where exactly have I messed up? Here is the current code that I am working with.
  3. Okay. I will give this a try. I had thought it would have overridden the old ones. Thanks for the tip! -Edit- Works perfectly now. Thanks a ton!
  4. I have went through the forums and multiple posts and have came up with the following code. However, the bit of code doesn't seem to change anything, regardless of what I have tried. My goal is to have the damage increase depending on the amount of mobs killed, and also to increase the speed of the sword based on this. Neither of the modified stats are having any effect on the sword in the game. To test the method, I changed the attackMod to a flat 100 and it still only did 8 damage. @Override public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot){ Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot); if (equipmentSlot == EntityEquipmentSlot.MAINHAND){ multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", (double)super.getAttackDamage() + 100, 0)); multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.4D + speedMod, 0)); } return multimap; } The whole file can be found here If any other code is needed, ask and I shall provide. Thanks in advance!
  5. Hello, what I am trying to do, Is for my elevator mod, have the player's screen fade to black, then teleport the player to another floor, then fade the black out. I did see a post regarding something similar, regarding a similar effect when you start losing air under water. Using what I saw there, I attempted two of the methods listed there but I could use some more input in to how I would go about implementing it. That page can be found here. The code that I have atm are as follows public static void renderBlindness(){ ScaledResolution scaledresolution = new ScaledResolution(Minecraft.getMinecraft()); int i = scaledresolution.getScaledWidth(); int j = scaledresolution.getScaledHeight(); Minecraft.getMinecraft().mcProfiler.startSection("elevator"); GlStateManager.disableDepth(); GlStateManager.disableAlpha(); int j1 = 10; float f1 = (float)j1 / 100.0F; if (f1 > 1.0F) { f1 = 1.0F - (float)(j1 - 100) / 10.0F; } int k = (int)(220.0F * f1) << 24 | 1052704; drawRect(0, 0, i, j, k); GlStateManager.enableAlpha(); GlStateManager.enableDepth(); Minecraft.getMinecraft().mcProfiler.endSection(); } With this code I am at a fault for trying to figure out how to have it render properly. But that is only a slightly modified version of the way that vanilla minecraft does the fade for the bed. This is the other code that is my attempt to mess with the blindness potion effect: @Subscribe public void fogDensity(FogDensity event){ if(event.entity instanceof EntityLiving){ EntityLiving entity = (EntityLiving)event.entity; PotionEffect effect = entity.getActivePotionEffect(Potion.blindness); if(effect != null && effect.getAmplifier() == 255){ event.density = 2; } } } What I was trying to get that to do, is when a player has the blindness effect with an amplifier of 255 to change the density. but I didn't see much change when I tested in the debug mode. Anyways, The way that I had attempted to run the first one, was just calling it before the method to teleport the player to the other elevators. The second one was registered (I may have done it the wrong way, as it has been a while since the last time I have coded) but I just used "FMLCommonHandler.instance().bus().register()" to register the FogDensity. Any help is welcome, feel free to give me constructive advice on what I can do better, this is my attempt to get my 1.7.10 mod upgraded for all the versions, I have builds for each version (1.8.9, 1.9, 1.9.4, 1.10.2, 1.12.2) but there are some bugs I need to iron out, and I was hoping to add this black out method to them when I update. -Elrol
  6. Can I ask why I should not condinally register items.
  7. I am working on a mod that has the option of disabling parts of the mod. Like when im registering items i have a check and if its false it wont register some items. But since the recipes are json files now I am unsure how to have them enabled when a boolean is true and disabled when its false. Any help with this would be greatly appreciated.
  8. Ok, well good to know about the playerLocation, that explains alot really. Ok thanks for the help, i will see what i can do. well now i have the command place a crafting table at 0, 1, 0 and it opened the gui for a split second. the issue is that now its too far away that the player cant open it, there is only one way i can think of getting it to work, and that is to set a block around them to the crafting table and when they close the ui to remove the table, is there a better way to do it without having players need the mod too?
  9. I am trying to make a command to open a crafting table gui, when i run the command, it crashes the server. here is the code i have for the command: @Override public CommandResult execute(CommandSource src, CommandContext args) throws CommandException { if (src instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) src; player.displayGui(new BlockWorkbench.InterfaceCraftingTable(player.worldObj, player.playerLocation)); player.addStat(StatList.CRAFTING_TABLE_INTERACTION); } else { src.sendMessage(Text.of(TextColors.RED, "Must be a player to run this command")); } return CommandResult.success(); } and this is the error it sends to the logs: If you can tell me what im doing wrong that would help. I know that the crash was caused by the world object being null, but how is that possible when i take it right from the player? The code i am using to open the gui is the same as the way minecraft does it when a player activates the crafting bench. I am assuming there is a better way to do it, but I am not sure what it would be.
  10. I had assumed as much, but how would i stop the items from being picked up, how would i populate the gui inventory with items, and all that
  11. First let me start out by saying, I know that GUIs are on the client side not server side, However, I want to be able to have the server open a GUI for a player who runs a command, then in that GUI find out when a player clicks an item, and when such an item is clicked have it either execute a runnable or run a command. There is already a mod/plugin that allows people to set up their own guis called VirtualChest. It works, but I need to be able to have the GUI and items i have displayed use info from the player that opened the GUI. For example, I would have one Item display the current blance of a player, but i want the balance to be the balance of the player that opened the GUI in the first place, VirtualChest cant do this, and it also cant execute runables, I have looked on google for a while but any tutorial i find is just for how to make a GUI, not how to make a GUI menu of sorts. My goal with posting here is to find a tutorial, or have someone explain to me how I would go about setting this up. I hope that I have explained what I am looking for, and if I havent just ask away. Thanks in advance!
  12. A plugin is just a server side mod, we are using forge and sponge and they should be the same( plugins and mods)
  13. Damn, the reason I ask is because I am trying to make a way for a player to run a command and basically /vanish without being invisible. the /vanish makes them a spectator and this is what pixelmon checks for when spawning pokemon, if they are a spectator then no pokemon spawn. and for some people on our server that lags them like crazy, so i was trying to make a command to change that flag so that no pokemon would spawn around them. do you know of any other way to do this?
  14. I am simply looking for a way to change this "Player.isSpectator()" from true to false, and back again, without changing the gamemode. I am looking around in the forge methods and I cant seem to find where the change happens. Any help is welcomed.
  15. That is pointless information. 1.7.10 is still widly used, I have still seen 1.6.4 servers and packs too. Just because there is a newer version does not mean that everyone wants to use the newer versions.
  16. capabilities are only for 1.8+ otherwise I would. Enough people are using 1.7.10 still, and once I get 1.7.10 released, I will upgrade to 1.8.9, 1.10, 1.11, that link offers a way to use a system similar to capabilities but for 1.7, and I cant get it to work.
  17. I am working on making a guiOverlay for my mod, and what I have at the moment doesnt seem to work, I am trying to have my overlay (which is in a Subscribed event for RenderGameOverlayEvent.Post) to get a config file, located on the server side. the information it is trying to get will determin how full or empty the overlay is (its basically a mana bar) I attempted to use a tutorial to add custom stats located here: http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/2683955-1-7-10-custom-stats-mana-currency-and-more how ever it doesnt seem to work. I made a post on it, but it has yet to be answered. So I went about it a different way, and have it and all the other stats and skills saved to a custom config file that is put in the player data folder using the players uuid with the .skill extension. I then have the clients get the skills and stats from the config file to determine different things. but since the gui is client only it cant get the config from the server to render the mana bar. so it stays full. I was thinking that I could use the Packet system to request the info from the server, but then in the packet from the server to the client in the onMessage() method, I am unsure of how to use the info stored in the packet to render the GUI and I feel like there is a much better way to go about this. Any help is welcome. -Elrol
  18. thanks, i will take a look, i had used his earlier example for 1.7. i will see what i can do
  19. I am working on updating my mod from 1.7.10 to 1.8.9. In 1.7 i had an inventory that can hold a single block and that block changes the look of the block to the one in the inventory. but with the new json rendering thing i have no idea about how to even touch this. if you can give me any information about how to get this done, I would be grateful.
  20. I figured that modder support indicates a place where modders can get help, and i am needing help with textures so yeah. where would you suggest i go to find a person who can do textures?
  21. Do you know of a mod that has an api or something that would make this easier? like baubles or Travellers Gear? I am starting at version 1.8.9, then doing 1.9.4 and 1.10 so i need a mod that is also updated to these versions
  22. I am trying to figure out how to render the armor the player wears differently as the subject suggests. My intentions are to make the chest plate into a full body armor, and to make the leggings into gauntlets, so, I am trying to find out how to make the chest plate render on the legs as well as the chest and to make the leggings render on the hands like a pair of gauntlets. If anyone has an idea as to how I would make this happen I would gladly like to know. Thanks
×
×
  • Create New...

Important Information

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