Jump to content

(SOLVED) [1.14.4] Block Ticking and Properties


MineModder2000

Recommended Posts

3 hours ago, MineModder2000 said:

Well for example there is the Is_On_Fire flag for entities, where is the class that shows how this is used?

You mean for how, when entities on fire die, they drop cooked meat?

That's  handled by the EntityHasPropertyEntityPredicate, and EntityFlagsPredicate classes. Its pretty complicated. EntityFlagsPredicate#test is probably what you're looking for.

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Actually I figured out a different and more desirable way to do it. I need now, to learn how to use IntegerProperties. I made one but I want to either increment or decrement it based on some check in the tick() method, I don't know how to do that. The with() method inside of state will set it to a discrete value, whereas I want to basically i++ or i-- the value. 

Edited by MineModder2000
Link to comment
Share on other sites

30 minutes ago, MineModder2000 said:

I don't know how to do what. The with() 

state.with(state.get(...)+1)

  • Thanks 1

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I have a problem. I can't use both this IntegerProperty and the BooleanProperty I made before. If I set the block state to the integer, then to the boolean later in the tick() method, the integer property is overriden, Instead of incrementing every time the method is called as desired, it starts from whatever I have the value set to in the constructor. It only works if comment out the line that sets the boolean property. 

Edited by MineModder2000
Link to comment
Share on other sites

4 hours ago, MineModder2000 said:

It only works if comment out the line that sets the boolean property. 

setBlockState(state.with(integerProp, state.get() + 1))

// then

setBlockState(state.with(booleanProp, false))

// is not the same as

setBlockState(state.with(integerProp, state.get() + 1).with(booleanProp, false)

 

Does that make sense?

  • Thanks 1

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

16 hours ago, Animefan8888 said:

setBlockState(state.with(integerProp, state.get() + 1))

// then

setBlockState(state.with(booleanProp, false))

// is not the same as

setBlockState(state.with(integerProp, state.get() + 1).with(booleanProp, false)

 

Does that make sense?

Definitely does, only one state at a time, I reworked by logic around this and it works now ?

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements




×
×
  • Create New...

Important Information

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