Skip to content
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

EntityData - check if entity can spawn #6484

Merged
merged 6 commits into from
Mar 9, 2024

Conversation

ShaneBeee
Copy link
Contributor

@ShaneBeee ShaneBeee commented Mar 6, 2024

Description

This PR aims to add a check to see if a specific entity can spawn dependant on data packs.
Minecraft has started adding "Experimental Datapacks" which allow the server owner to use new things which are aimed for the next major update.

Currently in Skript, if a data pack is not enabled, and you attempt to spawn one of these entities an error is thrown.
This applies a check before spawning the entity.

I added a method rather than just directly applying this in the spawn method, this way classes which extend and override this method can also check using this method.

Also fixed a couple typos that were right there.

NOTE: Incase anyone wonders, we don't have to do this for items too. You can actually give an experimental item to a player and it will have in the lore "Disabled Item"
Same with setting a block, it works.


Target Minecraft Versions: any
Requirements: none
Related Issues: #6483

@AyhamAl-Ali AyhamAl-Ali added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Mar 6, 2024
Copy link
Member

@AyhamAl-Ali AyhamAl-Ali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work Shane ⚡

src/main/java/ch/njol/skript/entity/EntityData.java Outdated Show resolved Hide resolved
ShaneBeee and others added 2 commits March 6, 2024 08:53
Co-authored-by: Ayham Al Ali <20037329+AyhamAl-Ali@users.noreply.github.com>
@APickledWalrus APickledWalrus changed the base branch from master to dev/patch March 6, 2024 17:01
Copy link
Member

@AyhamAl-Ali AyhamAl-Ali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not just Sovde giving double approval!

@APickledWalrus APickledWalrus merged commit d864baa into SkriptLang:dev/patch Mar 9, 2024
4 checks passed
@ShaneBeee ShaneBeee deleted the fix/entity-can-spawn branch March 29, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants