#Bounciness component

1 messages · Page 1 of 1 (latest)

native osprey
#

Feel free to use this in your addons, will be glad if you mention me! To use add the component to your block, add block type id to bouncyBlocks and add the tag nakerdev:bounciness_[your number here] to your block to control bounciness from json. Bounciness of 2 is almost the same as the slime block.
I also made a small runInterval to prevent fall damage with resistance effect, tried with player.json but it didn't worked
Big bounciness can lead to it not jumping lower! You can change the value where i marked to control that
Code below

#

You can remove the last runInterval if you don't need to prevent fall damage/have another way to do it!

#

remove type annotations for JS

dense quest
native osprey
#

i wanted to use damage sensor in player json

#

add and remove a component group

#

but somewhy it didn't work

dense quest
native osprey
#

feather falling would be noticable

native osprey
#

i'll only remove fall damage

dense quest
native osprey
obtuse glacier
#

just use slow falling. It specifically made you immune to fall damage lol

native osprey
#

It's easy to notice that the falling is slowed at the end

obtuse glacier
#

And only apply the effect if you're 5 blocks or taller

#

you can probably track the fall distance right?

willow barn
#

Tags are a neat way to get around not having parameters for custom components 🙂

dense quest
willow barn
#

Was talking about the original post, the nakerdev:bounciness_[your number here] tags

dense quest
#

ah
good to know

#

whats the max tag length?

native osprey
#

I think it's likely 32k bytes

dense quest
#

nice

native osprey
#

Updated version.
Changes

  • Now Script does not need to be edited
  • New parameters - reduction, noFallDamage
  • New tag - "nakerdev:bouncy"

Tutorial:
Add component to the block;
Add necessary Tags:

  • "nakerdev:bouncy" - Marks the block as bouncy to check in some functions. Is NOT required BUT is highly recommended
  • "nakerdev:bounciness_[your number here, may be float]" - Specify the bounciness of the block. This is a REQUIRED parameter;
  • "nakerdev:bounciness.reduction_[your number here, may be float]" - Specify how much the impulse will be reduced. Uses division. Can be not specified - defaults to 2.*
  • "nakerdev:bounciness.noFallDamage" - this one does not require any numbers. This makes that falling on the block will not deal fall damage, can be specified even without bounciness component. Only for players.

* - Works like this, on first fall the impulse is the same, on second it's divided by 2(e.g. if it's set to 2), on third it's divided by 4, next time it's divided by 8, etc.

#

And also player.json is now required to be in bp/entities

ashen violet
#

Thank you!

#

Do you have a video?

native osprey
#

no sadly 😦

neat python
#

noice

native osprey
#

And another update! New parameter:

  • "nakerdev:bounciness.impulseLimit_[your number here, may be float]" - limits the impulse.
    If set to 10 the maximum impulse you can get will be equal to 10 blocks,
    even if you jumped from a bigger height. Has no default value,
    if not specified there's no limit.
native osprey
grand oriole
#

@native osprey, added your role

native osprey
native osprey