Jump to content

sarxworks

Members
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

sarxworks's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thanks. I completely forgot Entity spawning is Server-Side
  2. Hello. Been fiddling with creating a new trident item but I've hit a hitch. I've got the item itself to launch the trident entity on right-click, however I can't get my custom model to work. I have already registered renderer and attached it to the entity already. Custom Trident Item Class: https://pastebin.com/khQLVKrG Custom Trident Entity: https://pastebin.com/vc3bjw0G Custom Trident Model: https://pastebin.com/hzsUHsU9 Custom Trident Renderer: https://pastebin.com/g0b0Wneq Entity Register Class: https://pastebin.com/t1MWyRdk Client Registry Class: https://pastebin.com/HssBJALh FYI: This is a group project so not all the code is mine. Only the Custom Trident entity, Renderer, Model, and Item are specifically my code. The others only contain references to register my code at initialization. This is a repost: I accidentally posted in the wrong forum.
  3. Alright I've gotten the lightning to work, it only shows in the sky however but I did that purposely by removing one of the lines of code. Thanks to everybody who gave their help
  4. I've taken a MOOC class over the summer so I understand the basics of the Java like OOP, Basic methods, modifiers, flow statements and the other fundamentals. If I need to know more I'm more than willing to learn. I figured that after a while because I was wondering what purpose the ItemStack had in the method. Alright I will try that.
  5. Alright so I first realized that one of the value "worldIn" was a mistake by me. I meant to use "world". I have changed the code around and used world.isRemote however I'm still not getting a response from right clicking. I'm not worrying too much about cleaning up the code as of right now, just trying to test things out. This is what I have: I even tried referencing the class in the main class to see if the event was not initializing but no change. Is it that I did not use the @Override annotation or no?
  6. Hello All :), I am relatively new to minecraft modding so I might be a bit unsure about certain things. I have a basic grasp on Java programming so I would say I somewhat understand how the code works and I'm constantly trying to learn but I've hit a snag. Basically I'm trying to make a basic sword that fires lightning bolts on right click however I can't seem to get the code to work. This is currently what I'm using: public BoltSword(String unlocalizedName, ToolMaterial material) { super(unlocalizedName, material); } public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) { if (worldIn.isRemote) { RayTraceResult result = playerIn.rayTrace(100, 1F); int x = result.getBlockPos().getX(); int y = result.getBlockPos().getY(); int z = result.getBlockPos().getZ(); EntityLightningBolt lightning = new EntityLightningBolt(worldIn, x, y, z, false); worldIn.addWeatherEffect(lightning); } return new ActionResult(EnumActionResult.SUCCESS, itemStackIn); I've tried searching endless posts and this was the furthest I've gotten however it still won't work. I will appreciate any help given and I'm open to any suggestions you guys may recommend me. Thanks!
×
×
  • Create New...

Important Information

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