Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Own attribute
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
TechoMan

Own attribute

By TechoMan, May 18, 2014 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

TechoMan    1

TechoMan

TechoMan    1

  • Tree Puncher
  • TechoMan
  • Members
  • 1
  • 33 posts
Posted May 18, 2014

I want to make my own attributes , like damage resistance and stuff like that. I'm loving attribute system , and how it works.So question is - can i make my own attribute?

  • Quote

Share this post


Link to post
Share on other sites

coolAlias    746

coolAlias

coolAlias    746

  • Reality Controller
  • coolAlias
  • Members
  • 746
  • 2805 posts
Posted May 18, 2014

Yes, you can, but if you want your attribute to be included in vanilla mobs, you will have to add it either via ASM or during EntityJoinWorldEvent, at which point you can add it to the attribute map with whatever value you want.

  • Quote

width=228 height=100http://i.imgur.com/NdrFdld.png[/img]

Share this post


Link to post
Share on other sites

TechoMan    1

TechoMan

TechoMan    1

  • Tree Puncher
  • TechoMan
  • Members
  • 1
  • 33 posts
Posted May 18, 2014

no i want them to be added to players , and stuff like that , by myself in mod.I want make items that will give some effects , but i dont want to make own attribute system , if there is alredy one exists ;)

And its good , what i can make that.Can you give example of cheking , does player have attribute or no?

  • Quote

Share this post


Link to post
Share on other sites

coolAlias    746

coolAlias

coolAlias    746

  • Reality Controller
  • coolAlias
  • Members
  • 746
  • 2805 posts
Posted May 18, 2014

You will still need to add the attributes to the player somehow, possibly with IExtendedEntityProperties or during EntityConstructing event. As for checking the attributes, just look at any of the vanilla Entity classes and you will see plenty of examples of adding and checking attributes.

  • Quote

width=228 height=100http://i.imgur.com/NdrFdld.png[/img]

Share this post


Link to post
Share on other sites

TechoMan    1

TechoMan

TechoMan    1

  • Tree Puncher
  • TechoMan
  • Members
  • 1
  • 33 posts
Posted May 18, 2014

You will still need to add the attributes to the player somehow, possibly with IExtendedEntityProperties or during EntityConstructing event. As for checking the attributes, just look at any of the vanilla Entity classes and you will see plenty of examples of adding and checking attributes.

you can easy add attributes via potions....Heh , will search if noone know that...maybe will make tuts for people like me :D

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Shrayzz
      Forge 1.4.7 : Problèmes d'installation

      By Shrayzz · Posted 6 minutes ago

      Bonjour, j'aimerais me faire une partie en 1.4.7 moddé car certains mods ne sont disponibles que sur cette version. Récemment, j'ai acheté une nouvelle voiture pc l'ancien ne marchait plus. Le problème, c'est qu'étant donné que le fichier "minecraft.jar" du dossier "bin" de ".minecraft" n'existe plus. Le type d'installation de forge n'est plus le même qu'avant, je suis donc allé voir sur des forums pour savoir comment je pourrais faire mais tous sont obsolètes. Pourriez-vous m'aider à installer cette version, je voulais savoir si on pouvait toujours en faire des serveurs avec cette version? Merci de votre réponse.
    • PedreHenrry
      my minecraft crashed by "rendering overlay"

      By PedreHenrry · Posted 10 minutes ago

      tomorrow i do this  
    • ChampionAsh5357
      How to register WallOrFloorItem / Torch

      By ChampionAsh5357 · Posted 1 hour ago

      Nope, you're just registering the item twice. Your block calls this method which creates an item to which you then create another item under the same name.
    • StealthyNoodle
      How to register WallOrFloorItem / Torch

      By StealthyNoodle · Posted 1 hour ago

      Certainly! https://github.com/Fnkee/solidrocks I see that I'm running a copy method on the torch, under the ItemTagsProvider (ModItemTagsProvider). That should be transfering data from the block tag into an item tag. Maybe that's what's causing the duplicate registration.
    • Sr_endi
      [1.16.4]How to set the light value of an block

      By Sr_endi · Posted 1 hour ago

      Hey, i know I can set the light value with the Properties when I create a Block. But I want to set the light level in tick() of an TileEntity. I already know how to get the Block/BlockState, but I do not know how to set the light value. How can i set it?
  • Topics

    • Shrayzz
      0
      Forge 1.4.7 : Problèmes d'installation

      By Shrayzz
      Started 6 minutes ago

    • PedreHenrry
      4
      my minecraft crashed by "rendering overlay"

      By PedreHenrry
      Started 4 hours ago

    • StealthyNoodle
      5
      How to register WallOrFloorItem / Torch

      By StealthyNoodle
      Started 13 hours ago

    • Sr_endi
      0
      [1.16.4]How to set the light value of an block

      By Sr_endi
      Started 1 hour ago

    • Titan7272
      6
      1.16.4 "Missing Forge!" Crash on start up

      By Titan7272
      Started Wednesday at 07:10 PM

  • Who's Online (See full list)

    • Shrayzz
    • Draco18s
    • Nuparu00
    • Choonster
    • gottsch
    • Fnaf_zodiac
    • ChampionAsh5357
    • Abdymazhit
    • Babatunde
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Own attribute
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community