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

custom helmet example script fix #4053

Closed
OGContent opened this issue Jun 3, 2021 · 1 comment
Closed

custom helmet example script fix #4053

OGContent opened this issue Jun 3, 2021 · 1 comment
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.

Comments

@OGContent
Copy link

OGContent commented Jun 3, 2021

(So the first thing the preset script fix because this preset script allows a dupe, if ur helmet slot was air and you tried to put in the custom helmet the helmet slot will become ur custom helmet + ur cursor would still have the custom helmet

# Allows specified items to be used as helmets for survival players (Minecraft 1.9 recommended).
#

aliases:
    custom helmets = iron block, gold block, diamond block # Change this to anything you'd like

on inventory click:
    inventory action is place all or nothing
    cursor slot of player is custom helmets # Check if item is allowed as helmet
    event-slot is helmet slot of event-player # Check that player clicked the helmet
    cancel the event
    set {_old helmet} to helmet of player # Store old helmet
    set helmet of player to cursor slot of player # Set new helmet to item in player's cursor
    set cursor slot of player to {_old helmet} # Set player's cursor to old helmet, possibly air

on right click:
    tool of player is custom helmets
    helmet of player is air
    cancel the event
    set helmet of player to tool of player
    set tool of player to air

so the last 3 lines of the on inventory click: is the issue and it should be updated to

    set {_old helmet} to helmet of player # Store old helmet
    if event-slot is air: # Checks if the helmet slot is air
        set helmet of player to cursor slot of player # Set new helmet to item in player's cursor
        set cursor slot of player to air # Will set player's cursor to air
        stop #Stops the code
    set helmet of player to cursor slot of player
    set cursor slot of player to {_old helmet} # Set player's cursor to old helmet

edit: the fix didn't work after 1 restart ;/

@TPGamesNL
Copy link
Member

2nd is duplicate of #3899

@TPGamesNL TPGamesNL changed the title 2 Things, a preset script fix and advancement event custom helmet example script fix Jun 3, 2021
@TPGamesNL TPGamesNL added enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. labels Jun 3, 2021
@APickledWalrus APickledWalrus added the PR available Issues which have a yet-to-be merged PR resolving it label Aug 15, 2021
@TPGamesNL TPGamesNL added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.
Projects
None yet
Development

No branches or pull requests

3 participants