Jump to content

Recommended Posts

Posted

I want make Sword Skill.

I could cording RightClickEvent and I confirmed to move well.


    @Mod.EventBusSubscriber
    public static class ClickRegistryHandler {
        @SubscribeEvent
        public static void onItemRightClick(PlayerInteractEvent.RightClickItem event){
            Item[] swords = {
                    Items.ender_sword,Items.ice_sword,Items.obsidian_sword
            };
            EntityPlayer player = event.getEntityPlayer();
            if(Arrays.asList(swords).contains(player.getHeldItemMainhand().getItem())){
				/* If player have ModsSword in right hand, code will be executed here. */
            }
        }
    }

I need to create **Attack the Mob in the line of sight** code.
But I cant and I don't know how can I implementation it.
※I'm Jap and I cant speak English well, but I couldn't find good information in Japanese web-site. pls help me !!

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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