-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entity docs #171
base: main
Are you sure you want to change the base?
Entity docs #171
Conversation
Co-authored-by: Dennis C <[email protected]>
Co-authored-by: Dennis C <[email protected]>
Co-authored-by: ChampionAsh5357 <[email protected]>
@IchHabeHunger54, this pull request has conflicts, please resolve them for this PR to move forward. |
# Conflicts: # docs/items/index.md # docs/items/interactionpipeline.md # docs/items/tools.md # docs/resources/server/enchantments/builtin.md
…DeferredSpawnEggItem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comments without looking at the sections that still need to be written. Make sure the information is relevant to 1.21.3. Otherwise, nice job.
```java | ||
@Override | ||
// The boolean return value determines whether the entity was actually damaged or not. | ||
public boolean hurt(DamageSource damageSource, float amount) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hurt
is a final method, are you trying to refer to hurtServer
and hurtClient
? I'm guessing this was probably written before the 1.21.2 update.
|
||
- `#tick`: This is the central tick method, and the one you will want to override in 99% of cases. | ||
- By default, this forwards to `#baseTick`, however this is overridden by almost every subclass. | ||
- `#baseTick`: This method handles updating some values common to all entities, including the "on fire" state, freezing from powder snow, the swimming state, and passing through portals. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When should I override baseTick
then?
Natural spawning is performed every tick for entities where `MobCategory#isFriendly()` is true, and every 400 ticks (\= 20 seconds) for entities where `MobCategory#isFriendly()` is false. If `MobCategory#isPersistent()` returns true, this process additionally also happens on chunk generation. | ||
|
||
For each chunk and mob category, it is checked whether there are less than `MobCategory#getMaxInstancesPerChunk() * loadedChunks / 289` in the world. Additionally, for each chunk, it is required that there are less than `MobCategory#getMaxInstancesPerChunk()` entities of that `MobCategory` near at least one player (near means that the distance between mob and player \<\= 128) for spawning of that `MobCategory` to occur. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the detail is good, but it is also very confusing to read and understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't disagree, I just felt it was important to mention it here regardless, and I'm unsure how to improve this.
Adds some long-needed entity documentation. Supersedes #15 and #95 . Closes #90 . This PR:
This PR is a draft, and many sections are TODOs. Opening now for early feedback.
Preview URL: https://pr-171.neoforged-docs-previews.pages.dev